AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-587805

pugazhendhi's questions

Martin Hope
pugazhendhi
Asked: 2021-07-24 06:14:39 +0800 CST

使用嵌套来分类多个文件

  • 1

我需要创建从 2 个列表文件输入的用户,如下所示:

cat user.yml
user1
user2
user3

cat group.yml
group1
group2
group3

cat playbook.yml
- name: Add the user
  user:
    name: "{{ item[0] }}"
    group: "{{ item[1] }}"
  with_nested:
    - cat user.yml
    - cat group.yml

这两个文件将从其他任务中动态获取输入,因此我将无法像那样提及 ['user1', 'user2'] 中的列表。请建议如何使用 with_nested 对两个列表进行分类

users ansible
  • 1 个回答
  • 185 Views
Martin Hope
pugazhendhi
Asked: 2021-07-03 04:06:00 +0800 CST

安装 pyobdc

  • 0

我正在尝试使用 pip3 安装 pyodbc 但出现以下错误:

[hvr@07EUW1HVRHAP02A ~]$ pip3 install pyodbc
Collecting pyodbc
  Using cached https://files.pythonhosted.org/packages/81/0d/bb08bb16c97765244791c73e49de9fd4c24bb3ef00313aed82e5640dee5d/pyodbc-4.0.30
.tar.gz
Installing collected packages: pyodbc
  Running setup.py install for pyodbc ... error
    Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-dp0ls1b2/pyodbc/setup.py'
;f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" insta
ll --record /tmp/pip-0dv3z9sq-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_ext
    building 'pyodbc' extension
    creating build
    creating build/temp.linux-x86_64-3.6
    creating build/temp.linux-x86_64-3.6/src
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-s
trong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DPYODBC_VERSION=4.0.30 -I/
usr/include/python3.6m -c src/buffer.cpp -o build/temp.linux-x86_64-3.6/src/buffer.o -Wno-write-strings -DHAVE_UNISTD_H -DHAVE_PWD_H -D
HAVE_SYS_TYPES_H -DHAVE_LONG_LONG -DSIZEOF_LONG_INT=8 -I/usr/include
    In file included from src/buffer.cpp:12:0:
    src/pyodbc.h:56:17: fatal error: sql.h: No such file or directory
     #include <sql.h>
                     ^
    compilation terminated.
    error: command 'gcc' failed with exit status 1
   
    ----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-dp0ls1b2/pyodbc/setup.py';f=getattr(tokenize, 'op
en', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-0dv
3z9sq-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-dp0ls1b2/pyod
bc/
python pip
  • 1 个回答
  • 529 Views
Martin Hope
pugazhendhi
Asked: 2020-08-14 08:43:51 +0800 CST

当ansible playbook中存在分区时如何编写when条件

  • 0

当 /var 分区存在时,我正在尝试写入任务。我使用了断言变量

- name: Apply patch if /var exist and > 300MB
  yum:
    name: '*'
    state: latest
  loop: "{{ ansible_mounts }}"
  when: item.mount == "/var" and item.size_available > 300000000

如果 /var 不存在,它应该会失败或跳过。这没有发生。如果 /var 不存在,请建议如何跳过

ansible-playbook
  • 1 个回答
  • 2124 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve