logic for local connection if the jenkins server is the target
This commit is contained in:
@@ -22,5 +22,8 @@ groups:
|
|||||||
zabbix_targets: "'zabbix' in (proxmox_tags | default([]))"
|
zabbix_targets: "'zabbix' in (proxmox_tags | default([]))"
|
||||||
|
|
||||||
compose:
|
compose:
|
||||||
ansible_host: name + '.lan'
|
# If this host's Proxmox name matches the controller's hostname, connect locally
|
||||||
|
# instead of SSHing back into the machine running the playbook
|
||||||
|
ansible_connection: "'local' if name == lookup('pipe', 'hostname') else 'ssh'"
|
||||||
|
ansible_host: "lookup('pipe', 'hostname') if name == lookup('pipe', 'hostname') else name + '.lan'"
|
||||||
ansible_user: 'jenkins'
|
ansible_user: 'jenkins'
|
||||||
|
|||||||
Reference in New Issue
Block a user