diff --git a/roles/includes/get_rand_pass.yml b/roles/includes/get_rand_pass.yml index 267ff18..89d2bff 100644 --- a/roles/includes/get_rand_pass.yml +++ b/roles/includes/get_rand_pass.yml @@ -6,16 +6,15 @@ register: current_pass # When no pass exist, create a new one -- yum: name=pwgen - when: not current_pass.stat.exists and ansible_os_family == 'RedHat' -- apt: name=pwgen - when: not current_pass.stat.exists and ansible_os_family == 'Debian' -- shell: pwgen {% if complex | default(True) %}-y {% endif %}-s {{ pass_size | default(50) }} 1 | sed -e 's/[\"\`'"'"']//g' - register: rand_pass - when: not current_pass.stat.exists - # Now write this new pass -- copy: content={{ rand_pass.stdout | trim }} dest={{ pass_file }} mode=600 - when: not current_pass.stat.exists +- name: Install pwgen + package: name=pwgen + +- when: not current_pass.stat.exists + block: + - shell: pwgen {% if complex | default(True) %}-y -r \`\'\"\\\|\^\# {% endif %}-s {{ pass_size | default(50) }} 1 + register: rand_pass + # Now write this new pass + - copy: content={{ rand_pass.stdout | trim }} dest={{ pass_file }} mode=600 # When pass already exists, just read it - name: Read the password diff --git a/roles/repo_samba4/defaults/main.yml b/roles/repo_samba4/defaults/main.yml index 8547715..1629f7c 100644 --- a/roles/repo_samba4/defaults/main.yml +++ b/roles/repo_samba4/defaults/main.yml @@ -1,3 +1,3 @@ --- -# Select a branch from https://samba.tranquil.it/centos7/ -samba_major_version: stable +# Select a branch from https://samba.tranquil.it/centos7/ or https://samba.tranquil.it/centos7/ +samba_major_version: samba-{{ (ansible_distribution_major_version is version('8','<')) | ternary('4.12.15','4.14.7') }}