Move hostname parameter to separate variable
Update inventory to support hubble
This commit is contained in:
		@@ -32,18 +32,18 @@ en1:
 | 
				
			|||||||
        skylab_targets: [cluster, datastore]
 | 
					        skylab_targets: [cluster, datastore]
 | 
				
			||||||
        skylab_roles:
 | 
					        skylab_roles:
 | 
				
			||||||
          - server
 | 
					          - server
 | 
				
			||||||
          - docker-swarm-manager
 | 
					          - docker-swarm
 | 
				
			||||||
          - datastore
 | 
					          - datastore
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      hosts:
 | 
					      hosts:
 | 
				
			||||||
        pegasus:  # jupiter
 | 
					        pegasus:  # jupiter
 | 
				
			||||||
          ansible_host: 10.42.101.100
 | 
					          ansible_host: 10.42.101.100
 | 
				
			||||||
 | 
					          skylab_hostname: pegasus.skylab.enp.one
 | 
				
			||||||
          skylab_description: Arbiter Node
 | 
					          skylab_description: Arbiter Node
 | 
				
			||||||
          skylab_cluster:
 | 
					          skylab_cluster:
 | 
				
			||||||
            address: 10.42.101.10/24
 | 
					            address: 10.42.101.10/24
 | 
				
			||||||
            interface: bond0
 | 
					            interface: bond0
 | 
				
			||||||
          skylab_networking:
 | 
					          skylab_networking:
 | 
				
			||||||
            hostname: pegasus.skylab.enp.one
 | 
					 | 
				
			||||||
            dns: [10.42.101.1]
 | 
					            dns: [10.42.101.1]
 | 
				
			||||||
            gateway: 10.42.101.1/24
 | 
					            gateway: 10.42.101.1/24
 | 
				
			||||||
            interfaces:
 | 
					            interfaces:
 | 
				
			||||||
@@ -64,12 +64,12 @@ en1:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        saturn:  # remus
 | 
					        saturn:  # remus
 | 
				
			||||||
          ansible_host: 10.42.101.110
 | 
					          ansible_host: 10.42.101.110
 | 
				
			||||||
 | 
					          skylab_hostname: saturn.skylab.enp.one
 | 
				
			||||||
          skylab_description: Operational Node
 | 
					          skylab_description: Operational Node
 | 
				
			||||||
          skylab_cluster:
 | 
					          skylab_cluster:
 | 
				
			||||||
            address: 10.42.101.11/24
 | 
					            address: 10.42.101.11/24
 | 
				
			||||||
            interface: bond0
 | 
					            interface: bond0
 | 
				
			||||||
          skylab_networking:
 | 
					          skylab_networking:
 | 
				
			||||||
            hostname: saturn.skylab.enp.one
 | 
					 | 
				
			||||||
            dns: [10.42.101.1]
 | 
					            dns: [10.42.101.1]
 | 
				
			||||||
            gateway: 10.42.101.1/24
 | 
					            gateway: 10.42.101.1/24
 | 
				
			||||||
            interfaces:
 | 
					            interfaces:
 | 
				
			||||||
@@ -90,12 +90,12 @@ en1:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        orion:  # romulus
 | 
					        orion:  # romulus
 | 
				
			||||||
          ansible_host: 10.42.101.120
 | 
					          ansible_host: 10.42.101.120
 | 
				
			||||||
 | 
					          skylab_hostname: orion.skylab.enp.one
 | 
				
			||||||
          skylab_description: Operational Node
 | 
					          skylab_description: Operational Node
 | 
				
			||||||
          skylab_cluster:
 | 
					          skylab_cluster:
 | 
				
			||||||
            address: 10.42.101.12/24
 | 
					            address: 10.42.101.12/24
 | 
				
			||||||
            interface: bond0
 | 
					            interface: bond0
 | 
				
			||||||
          skylab_networking:
 | 
					          skylab_networking:
 | 
				
			||||||
            hostname: orion.skylab.enp.one
 | 
					 | 
				
			||||||
            dns: [10.42.101.1]
 | 
					            dns: [10.42.101.1]
 | 
				
			||||||
            gateway: 10.42.101.1/24
 | 
					            gateway: 10.42.101.1/24
 | 
				
			||||||
            interfaces:
 | 
					            interfaces:
 | 
				
			||||||
@@ -121,5 +121,7 @@ en2:
 | 
				
			|||||||
  hosts:
 | 
					  hosts:
 | 
				
			||||||
    hubble:
 | 
					    hubble:
 | 
				
			||||||
      ansible_host: en2a.enp.one
 | 
					      ansible_host: en2a.enp.one
 | 
				
			||||||
 | 
					      skylab_hostname: hubble.en2.enp.one
 | 
				
			||||||
      skylab_description: Cloud Web Server
 | 
					      skylab_description: Cloud Web Server
 | 
				
			||||||
      skylab_targets: [cloud]
 | 
					      skylab_targets: [cloud]
 | 
				
			||||||
 | 
					      skylab_roles: [server]
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -23,7 +23,7 @@
 | 
				
			|||||||
    - name: Set hostname
 | 
					    - name: Set hostname
 | 
				
			||||||
      become: true
 | 
					      become: true
 | 
				
			||||||
      ansible.builtin.hostname:
 | 
					      ansible.builtin.hostname:
 | 
				
			||||||
        name: "{{ skylab_networking.hostname | default(inventory_hostname) }}"
 | 
					        name: "{{ skylab_hostname | default(inventory_hostname) }}"
 | 
				
			||||||
        use: systemd
 | 
					        use: systemd
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    - name: Disable case-sensitive tab-completion
 | 
					    - name: Disable case-sensitive tab-completion
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user