使用Ansible Tower针对Openstack运行剧本

时间:2018-10-17 11:42:47

标签: ansible openstack ansible-tower

我正在尝试使用Ansible Tower在管理租户中针对Openstack运行一个简单的剧本,两者都在本地主机上运行。这是脚本:

--- # 
- hosts: localhost
  gather_facts: no
  connection: local 
  tasks:
  - name: Security Group
    os_security_group:
      state: present
      name: example

我已完成以下配置:

  • 凭据:

enter image description here

  • 模板:

enter image description here

  • 库存测试:

enter image description here

使用此配置,我会收到此错误:

TASK [Security Group] **********************************************************
13:35:48
fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "sudo: effective uid is not 0, is /usr/bin/sudo on a file system with the 'nosuid' option set or an NFS file system without root privileges?\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}

有什么想法吗?看起来是一个凭证问题。

1 个答案:

答案 0 :(得分:0)

取消勾选Enable Privilege Escalation-不必要。您的OpenStack特权/授权将与您的OpenStack凭据(在本例中为admin)绑定,而不是与运行Ansible任务的用户绑定。