Hot answers tagged

2

Q: Is it possible to have a pair of IPs in Ansible? A: Yes. It is possible. For example, it might be useful to create groups in the inventory with all pieces of information. [primary] 1.1.1.1 1.1.1.3 1.1.1.5 [standby] 1.1.1.2 1.1.1.4 1.1.1.6 [ha] 1.1.1.1 stdby=1.1.1.2 1.1.1.3 stdby=1.1.1.4 1.1.1.5 stdby=1.1.1.6 It's possible to simplify the fetching of ...


2

I'd suggest that you first put some default values within the playbook (if you explicitly want your variables there, for the purpose of .. reducing interactivity/command line args lets say): - hosts: all vars: user: greatuser passa: greatpassword Second, I'm pretty sure that pass is a reserved word somewhere, although I'm failing to find it in ...


1

map_public parameter set to true in the second link should do this.


1

any with_* is actully a local lookup. So as Zeitounator mentioned, you're going to need to use something like the find module to fetch the files you want. so I imagine that something like this would work: - hosts: primary remote_user: root tasks: - name: gather list of files to fetch find: paths: "/data1/" recurse: no ...


1

Q: Is it possible to share variables across instances? A: Yes. The dictionary hostvars keeps the variables. Quoting from Accessing information about other hosts with magic variables hostvars lets you access variables for another host, including facts that have been gathered about that host. You can access host variables at any point in a playbook. ... {{...


1

The task which fails is this one: - name: replace hostname in config replace: path: /opt/agentd.conf regexp: #\s+Hostname\= replace: Hostname={{hname}} backup: yes Try like this: - name: replace hostname in config replace: path: /opt/agentd.conf regexp: '#\s+Hostname\=.*$' replace: Hostname={{hname}} backup: ...


1

https://github.com/ansible/ansible/issues/55551 The fix is included in Ansible 2.8.3 or higher. I had the 2.8.2 version


Only top voted, non community-wiki answers of a minimum length are eligible