Browse Source

expand on dhcp info, fix var use

Grega Bremec 3 years ago
parent
commit
4bb85e1b26
3 changed files with 4 additions and 3 deletions
  1. 1 0
      prepare-deploy-sno1.yml
  2. 1 1
      roles/deploy-infra/tasks/main.yml
  3. 2 2
      roles/prep-work/tasks/main.yml

+ 1 - 0
prepare-deploy-sno1.yml

@@ -10,6 +10,7 @@
       name: node
       role: SNO
       cluster: sno1
+      online: yes
   roles:
     - role: check-env
       tags: check

+ 1 - 1
roles/deploy-infra/tasks/main.yml

@@ -73,7 +73,7 @@
     path: /etc/dhcp/dhcpd.conf
     insertafter: "^# BEGIN ANSIBLE MANAGED DHCP CONFIG$"
     regexp: "(?i)hardware ethernet {{ node.mac | regex_replace('^01-', '') | regex_replace('-', ':') }}"
-    line: 'host {{ node.name }}-{{ node.cluster }} { hardware ethernet {{ node.mac | regex_replace("^01-", "") | regex_replace("-", ":") }}; fixed-address {{ node.ip }}; option host-name "{{ node.name }}.{{ node.cluster }}.example.com."; }'
+    line: 'host {{ node.name }}-{{ node.cluster }} { hardware ethernet {{ node.mac | regex_replace("^01-", "") | regex_replace("-", ":") }}; fixed-address {{ node.ip }}; option host-name "{{ node.name }}.{{ node.cluster }}.example.com"; option domain-name "{{ node.cluster }}.example.com"; option domain-search "{{ node.cluster }}.example.com"; }'
     state: present
   notify: restart_dhcpd
 ...

+ 2 - 2
roles/prep-work/tasks/main.yml

@@ -88,8 +88,8 @@
 - name: Create a backup copy of cluster auth files
   become: no
   copy:
-    src: /home/lab/{{ cluster_name }}/auth/{{ item }}
-    dest: /home/lab/{{ item }}-{{ cluster_name }}
+    src: /home/lab/{{ node.cluster }}/auth/{{ item }}
+    dest: /home/lab/{{ item }}-{{ node.cluster }}
     remote_src: yes
     owner: lab
     group: lab