Skip to content
Snippets Groups Projects
Commit 13cd279f authored by jurgenhaas's avatar jurgenhaas
Browse files

New script to update hosts file and ssh config locally

parent 8f48c0c0
No related branches found
No related tags found
No related merge requests found
......@@ -9,21 +9,21 @@
- name: "Create The /etc/hosts File"
template:
src='etc_hosts'
dest='/etc/hosts'
owner='root'
group='root'
mode='644'
src: 'etc_hosts'
dest: '/etc/hosts'
owner: 'root'
group: 'root'
mode: '644'
- name: "Copy SSH Config For Server-To-Server Communication For Admins"
template:
src='ssh_config'
dest='/home/{{ item }}/.ssh/config'
owner='{{ item }}'
group='root'
mode='644'
src: 'ssh_config'
dest: '/home/{{ item }}/.ssh/config'
owner: '{{ item }}'
group: 'root'
mode: '644'
with_flattened:
- '{{ admins }}'
- '{{ admins|default([]) }}'
- '{{ jailusers|default([]) }}'
- name: "Read available variable cache files"
......
......@@ -10,8 +10,8 @@
- name: "Add Hosts to Hostfile"
lineinfile:
dest='/etc/hosts'
regexp='.* {{ item }}$'
line='{{ facts[item].static_ipv4 }} {{ item }}'
state=present
dest: '/etc/hosts'
regexp: '.* {{ item }}$'
line: '{{ facts[item].static_ipv4 }} {{ item }}'
state: 'present'
with_items: '{{ facts }}'
......@@ -47,6 +47,8 @@ ff02::2 ip6-allrouters
{% endfor %}
{% for host in commonauth_extras|default([]) %}
{% if host.ip is defined %}
{{host.ip}}{% for name in host['names'] %} {{name}}{% endfor %}
{% endif %}
{% endfor %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment