ansible-tower

How to specify become password for tasks delegated to localhost

依然范特西╮ 提交于 2021-01-29 17:27:27
问题 I have a playbook that targets a particular host. But there are few tasks that I need to execute locally, so i am using "delegate_to" for those tasks. A few locally delegated tasks require sudo privileges, so I used "become: yes" and passed --ask-become-pass through command line and it worked fine. But now when I have created a job on ansible tower, how do I manage to provide become password for the user(i guess awx user) that is running the job??? 回答1: You'll want to set the special variable

Can ansible variables be used to declare hosts in a playbook?

ぃ、小莉子 提交于 2020-12-06 03:43:48
问题 I have a playbook in the format below: --- - hosts: myIP tasks: - name: Install a yum package in Ansible example yum: name: ThePackageIWantToInstall state: present where myIP and ThePackageIWantToInstall are variables. When the job template runs, I would like the user in the extra variables popup to be able to go with: myIP = 192.168.1.1 ThePackageIWantToInstall = nano As the documentation doesn't provide an example of supplying a variable via a job template, is this possible? 回答1: Yes. -

Can ansible variables be used to declare hosts in a playbook?

被刻印的时光 ゝ 提交于 2020-12-06 03:40:29
问题 I have a playbook in the format below: --- - hosts: myIP tasks: - name: Install a yum package in Ansible example yum: name: ThePackageIWantToInstall state: present where myIP and ThePackageIWantToInstall are variables. When the job template runs, I would like the user in the extra variables popup to be able to go with: myIP = 192.168.1.1 ThePackageIWantToInstall = nano As the documentation doesn't provide an example of supplying a variable via a job template, is this possible? 回答1: Yes. -

Can ansible variables be used to declare hosts in a playbook?

做~自己de王妃 提交于 2020-12-06 03:40:17
问题 I have a playbook in the format below: --- - hosts: myIP tasks: - name: Install a yum package in Ansible example yum: name: ThePackageIWantToInstall state: present where myIP and ThePackageIWantToInstall are variables. When the job template runs, I would like the user in the extra variables popup to be able to go with: myIP = 192.168.1.1 ThePackageIWantToInstall = nano As the documentation doesn't provide an example of supplying a variable via a job template, is this possible? 回答1: Yes. -

Setting vault password in Ansible Tower

泄露秘密 提交于 2020-01-14 19:04:22
问题 I have used Ansible Vault to encrypt a file in which I have stored sensitive data. In my orchestration script below command is mentioned to run the playbook. ansible-playbook -i hosts -vvv Playbook.yml --ask-vault-pass This prompts user to provide password for Ansible vault. Now how can I achieve the same through Ansible Tower so that no manual intervention. I do not want this to done through password file as it is the requirement. Any suggestion would be great help. 回答1: On Ansible Tower, go

Custom credentials in Ansible Tower with Custom Python Script

房东的猫 提交于 2019-12-23 00:09:20
问题 I'm trying to implement a custom script in Ansible Tower to dynamically import an inventory. The custom script is basically written using Python and is interacting with a Windows 2012 Server which is acting as a domain controller (DC). When the script is executed from Ansible Tower, it pulls all the workstations from the DC and adds to the Ansible inventory. In doing so, I had to pass DC's login credentials in the Python script as a plain text, which is not desired. Hence was looking if there

Ansible: playbook calling Role in a directory that is in the roles directory

牧云@^-^@ 提交于 2019-12-07 04:07:25
问题 I would like to shape my directory structure of my ansible roles and playbooks. Currently I have a directory structure like. group_vars * all * group-one - group-vars.yml - group-vault.yml ... host_vars - server1.yml plays - java_plays * deploy_fun_java_stuff.yml * deploy_playbook.yml roles - role1 - tasks * main.yml - handlers - (the rest of the needed directories) - role2 - java - java_role1 - tasks * main.yml - handlers - (the rest of the needed directories) I would like to be able to call

How to add host to group in Ansible Tower inventory?

元气小坏坏 提交于 2019-12-06 10:27:42
问题 How can I add a host to a group using tower_group or tower_host modules? The following code creates a host and a group, but they are unrelated to each other: --- - hosts: localhost connection: local gather_facts: false tasks: - tower_inventory: name: My Inventory organization: Default state: present tower_config_file: "~/tower_cli.cfg" - tower_host: name: myhost inventory: My Inventory state: present tower_config_file: "~/tower_cli.cfg" - tower_group: name: mygroup inventory: My Inventory

Ansible: playbook calling Role in a directory that is in the roles directory

断了今生、忘了曾经 提交于 2019-12-05 10:56:28
I would like to shape my directory structure of my ansible roles and playbooks. Currently I have a directory structure like. group_vars * all * group-one - group-vars.yml - group-vault.yml ... host_vars - server1.yml plays - java_plays * deploy_fun_java_stuff.yml * deploy_playbook.yml roles - role1 - tasks * main.yml - handlers - (the rest of the needed directories) - role2 - java - java_role1 - tasks * main.yml - handlers - (the rest of the needed directories) I would like to be able to call upon the role java_role1 in the play deploy_fun_java_stuff.yml I can call --- - name: deploy fun java

How to add host to group in Ansible Tower inventory?

扶醉桌前 提交于 2019-12-04 15:39:28
How can I add a host to a group using tower_group or tower_host modules? The following code creates a host and a group, but they are unrelated to each other: --- - hosts: localhost connection: local gather_facts: false tasks: - tower_inventory: name: My Inventory organization: Default state: present tower_config_file: "~/tower_cli.cfg" - tower_host: name: myhost inventory: My Inventory state: present tower_config_file: "~/tower_cli.cfg" - tower_group: name: mygroup inventory: My Inventory state: present tower_config_file: "~/tower_cli.cfg" Docs mention instance_filters parameter ("Comma