Questions tagged [ansible-playbook]

468 questions
0
votes
1 answer

I cannot download MySQL ConnectorJ with ansible anymore

I have a task that looks like this: - name: Download {{ mysql_connector_download_url }} ansible.builtin.get_url: url: '{{ mysql_connector_download_url }}' dest: '{{ mysql_connector_download_dir }}/{{ mysql_connector_download_file }}' …
koenig
  • 125
  • 8
0
votes
1 answer

Ansible error getting again and again

ERROR! conflicting action statements: hosts, tasks The error appears to be in '/home/a899444/aerospike-ansible/roles/java_install/tasks/main.yml': line 1, column 3, but may be elsewhere in the file depending on the exact syntax problem. The…
0
votes
0 answers

Ansible playbook to read vars from plaintext file and log file checksums

In the process of learning ansible I am trying to create a playbook to run on some email hosts to gather sha1 hashes of the files. I have a plaintext file with the path and filenames the playbook needs to check. It is formatted as…
dj423
  • 23
  • 3
0
votes
1 answer

Ansible Findall capture groups and list

I think I'm confused with Python and Ansible findall. Can I use capture groups in Ansible? For example, How can I capture group 1 and group 2 then reverse the position in the resulting list? For example, I'm pulling some block devices info of a VM…
Billy K
  • 121
  • 1
  • 3
  • 16
0
votes
1 answer

Ansible and Jenkins: "winrm is not installed: cannot import name utils

I started to learn Ansible and Jenkins a few days ago. I'm stuck on one particular problem and despite many efforts can't figure it out. I have a very basic playbook that runs OK if I run it directly from the command line. Ansible and Jenkins are…
Okrx
  • 73
  • 1
  • 12
0
votes
0 answers

how to start nginx with ansible?

I installed nginx manually on my server, I started it to see if everything right then I "stopped" it. Active: inactive (dead) since Thu 2022-12-15 02:58:37 EST; 7min ago I am now using an ansible playbook to start it from my local computer but I…
0
votes
1 answer

Ansible: grep crontab files based on usernames extracted from /etc/passwd

I'm looking to extract a list of users from /etc/passwd and then grep their crontab files for disabled (commented: ^#) jobs. The high level steps would be: Grab an array of usernames from /etc/passwd ("my_users") Run grep against the files named in…
Mike
  • 23
  • 7
0
votes
1 answer

Ansible trouble while launching an exe through win_command

I'm currently writing a playbook about uninstalling Fusion Inventory Agent and then deploy GLPI agent 1.4 on Windows Server 2016-2022. For all the tests i detail below, i use my domain account which has admin rights on any servers. (I run ansible…
motorbass
  • 303
  • 2
  • 12
0
votes
1 answer

Ansible: Loop over the items of a host list and execute role

I have an application composed of micro modules distributed on multiple hosts. inventory: [moduleA_hostgroup] host1 host2 [moduleB_hostgroup] host2 host3 [moduleC_hostgroup] host1 host4 Each module has specific location and configuration files. I'd…
coquinho
  • 3
  • 2
0
votes
1 answer

Playbook to extract hosts from /etc/hosts

I need help extracting hosts informations from /etc/hosts file and exporting that content to a predefined file. I created a Ansible's Playbook to this task, but the content is not written on the output file. Do you guys, can help me,…
0
votes
1 answer

Setting apache2.conf variables with Ansible issue

i have a simple ansible playbook that sets two ini variables. - name: set Apache timeout community.general.ini_file: path: /etc/apache2/apache2.conf section: null option: Timeout value: 900 state: present exclusive: true -…
Aidvi
  • 46
  • 5
0
votes
1 answer

Ansible having an unhandled exception occurred while templating with lookup function

I'm currently building a playbook to test if some conf files are existing and then check the contents. Files are the following /etc/resolv.conf - then check if nameservers are well configured /etc/systemd/timesyncd.conf - check if something has…
motorbass
  • 303
  • 2
  • 12
0
votes
1 answer

Ansible Define Global Variables with When Contition

I want to define a global var (_cfg_chrony) based on Linux distributions: If the OS family is Redhat, define the config path of /etc/chrony.conf; if the OS family is Debian, define the config path of /etc/chrony/chrony.conf I tried to do something…
NeilWang
  • 383
  • 4
  • 14
0
votes
2 answers

ansible find: get path of a directory from register

Thanks in advance for any assistance. I can't seem to figure out what I am doing wrong hence why I am seeking some help. I wish to search for a folder using ansible, locate the folder and copy its contents to another directory. This is what I have…
nickyung
  • 1
  • 1
  • 2
0
votes
1 answer

Ansible - Alter Registered Variable

How can I modify the a registered variable? For Example, azure_network_interface_info.networkinterfaces[0].ip_configurations has public_ip_allocation_method which I'd like to change it to Static or Dynamic. Then use the ip_configurations array…
user630702
  • 495
  • 10
  • 32