Changeset - 5cef574d0b15
[Not reviewed]
0 2 0
x - 21 months ago 2023-08-21 22:51:41
xbr@c3l.lu
style: use inventory name for hostname + add network_index
2 files changed with 4 insertions and 4 deletions:
0 comments (0 inline, 0 general)
hosts
Show inline comments
 
@@ -6,13 +6,13 @@
 
#   - Blank lines are ignored
 
#   - Groups of hosts are delimited by [header] elements
 
#   - You can enter hostnames or ip addresses
 
#   - A hostname/ip can be a member of multiple groups
 

	
 
# server list is here
 
fflux-test ansible_host=89.58.3.252 new_hostname=fflux-test
 
fflux-test ansible_host=89.58.3.252 network_index=19
 

	
 
# machines which are used for tests
 
[test]
 
fflux-test
 

	
 
# variable for the test group come here
initial_server_setup/initial_setup.yml
Show inline comments
 
@@ -25,28 +25,28 @@
 
          - python3-pip
 
      tags: basic
 

	
 
    # Change Hostname
 
    - name: "Update Hostnames"
 
      ansible.builtin.hostname:
 
        name: "{{ new_hostname }}"
 
        name: "{{ inventory_hostname }}"
 
      tags: hostname
 

	
 
    # Update /etc/hosts
 
    - name: Make sure an IPV4 entry in /etc/hosts exists
 
      ansible.builtin.lineinfile:
 
        path: /etc/hosts
 
        regexp: "^{{ ansible_default_ipv4.address }}"
 
        line: "{{ ansible_default_ipv4.address }} {{ new_hostname }} {{ new_hostname }}.freifunk.lu"
 
        line: "{{ ansible_default_ipv4.address }} {{ inventory_hostname }} {{ inventory_hostname }}.freifunk.lu"
 
        state: present
 
      tags: network,hostname,dns
 
    - name: Make sure an IPV6 entry in /etc/hosts exists
 
      ansible.builtin.lineinfile:
 
        path: /etc/hosts
 
        regexp: "^{{ ansible_default_ipv6.address }}"
 
        line: "{{ ansible_default_ipv6.address }} {{ new_hostname }} {{ new_hostname }}.freifunk.lu"
 
        line: "{{ ansible_default_ipv6.address }} {{ inventory_hostname }} {{ inventory_hostname }}.freifunk.lu"
 
        state: present
 
      tags: network,hostname,dns
 

	
 
    # SSH security improvements (EmptyPass, PassAuth, RootLogin)
 
    - name: Disable SSH Password Auth
 
      ansible.builtin.copy:
0 comments (0 inline, 0 general)