Hi,
I'm trying to create a Playbook to synchronize some initialization scripts
and crontabs across a VCS cluster. The cluster itself is on RHEL5, so I am
trying to use a RHEL7 server as a controller.
The key restriction here is that we cannot have direct root login via the
network (i.e. "PermitRootLogins No" in /etc/ssh/sshd_config), so I need to
use an account that is able to use a passworded "sudo" in order to gain
root, which is needed to read or write these files.
Thus far, the only method I have managed to get to even come close to
working is to create an archive of these directories from the primary, pull
that back to the controller, then extract them on each of the secondary
nodes -- which is horribly clunky.
Approaches I have tried and failed on include trying to delegate the
synchronization to the master node, e.g.
- hosts: standby
become: true
tasks:
- name: copy crontabs to other nodes
copy:
src: /etc/cron.d/
dest: /etc/cron.d/
become: true
delegate_to: "{{ hostvars.localhost.primary }}"
-- but delegation in this context merely means that the controller is just
trying to copy files from itself to the master node each time.
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/03df1308-e41e-4fd4-8992-20391099a71c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.