mirror of
https://gitea.0xace.cc/ansible-galaxy/hosts.git
synced 2024-11-24 23:06:39 +00:00
rename parameter for hosts pinning
This commit is contained in:
parent
c78e3e0a37
commit
039c130c9b
@ -2,7 +2,7 @@ Add records in format ${ansible_host} ${FQDN} ${short} from inventory to /etc/ho
|
|||||||
|
|
||||||
Config example:
|
Config example:
|
||||||
|
|
||||||
pin_hosts: yes
|
hosts_pin: yes
|
||||||
|
|
||||||
Inventory example:
|
Inventory example:
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
pin_hosts: yes
|
hosts_pin: yes
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
- block:
|
- block:
|
||||||
- name: add ip address of all hosts to all hosts
|
- name: Add ip address of all hosts to all hosts
|
||||||
lineinfile:
|
lineinfile:
|
||||||
dest: /etc/hosts
|
dest: /etc/hosts
|
||||||
regexp: '.*{{ item }} {{ item.split(".")[0] }}$'
|
regexp: '.*{{ item }} {{ item.split(".")[0] }}$'
|
||||||
@ -8,7 +8,7 @@
|
|||||||
state: present
|
state: present
|
||||||
when:
|
when:
|
||||||
- hostvars[item].ansible_host is defined
|
- hostvars[item].ansible_host is defined
|
||||||
- pin_hosts
|
- hosts_pin
|
||||||
with_items: "{{ ansible_play_hosts_all }}"
|
with_items: "{{ ansible_play_hosts_all }}"
|
||||||
tags:
|
tags:
|
||||||
- hosts
|
- hosts
|
||||||
|
Loading…
Reference in New Issue
Block a user