Parcourir la source

Merge branch 'devel' into devel

Shubhangi-dell il y a 4 ans
Parent
commit
c28ad7262d

+ 2 - 2
roles/k8s_firewalld/tasks/main.yml

@@ -41,7 +41,7 @@
     permanent: yes
     state: enabled
   with_items: '{{ k8s_compute_ports }}'
-  when: "'compute' in group_names"
+  when: "'compute' in group_names and groups['manager'][0] != groups['compute'][0] and groups['compute']|length >= 1"
   tags: firewalld
 
 - name: Open flannel ports on the firewall
@@ -81,4 +81,4 @@
     name: firewalld
     state: stopped
     enabled: no
-  tags: firewalld
+  tags: firewalld

+ 5 - 3
roles/k8s_nfs_client_setup/tasks/main.yml

@@ -17,6 +17,7 @@
   package:
     name: nfs-utils
     state: present
+  when: groups['manager'][0] != groups['compute'][0] and groups['compute']|length >= 1
   tags: nfs_client
 
 - name: Check mounted share
@@ -33,6 +34,7 @@
     path: "{{ nfs_mnt_dir }}"
     state: directory
     mode: "{{ nfs_mnt_dir_mode }}"
+  when: groups['manager'][0] != groups['compute'][0] and groups['compute']|length >= 1
   tags: nfs_client
 
 - name: Mounting NFS Share
@@ -40,12 +42,12 @@
   changed_when: true
   args:
     warn: false
-  when: groups['manager'][0] not in mounted_share.stdout
+  when: groups['manager'][0] not in mounted_share.stdout and groups['manager'][0] != groups['compute'][0] and groups['compute']|length >= 1
   tags: nfs_client
 
 - name: Configuring Automount NFS Shares on reboot
   lineinfile:
     path: "{{ fstab_file_path }}"
     line: "{{ mounthost }}:{{ nfs_share_dir }}     {{ nfs_mnt_dir }}  nfs     nosuid,rw,sync,hard,intr 0 0"
-  when: groups['manager'][0] not in mounted_share.stdout
-  tags: nfs_client
+  when: groups['manager'][0] not in mounted_share.stdout and groups['manager'][0] != groups['compute'][0] and groups['compute']|length >= 1
+  tags: nfs_client

+ 2 - 1
roles/k8s_nfs_client_setup/vars/main.yml

@@ -14,10 +14,11 @@
 ---
 
 nfs_mnt_dir: /home/k8snfs
+
 nfs_share_dir: /home/k8snfs
 
 mounthost: "{{ groups['manager'][0] }}"
 
 nfs_mnt_dir_mode: 0755
 
-fstab_file_path: /etc/fstab
+fstab_file_path: /etc/fstab