Check for distro family, not distro specifically

A lot of these Just Werk on Debian
This commit is contained in:
Salt 2020-09-04 06:16:30 -05:00
parent 0f04972209
commit d73ce5cbd8
5 changed files with 10 additions and 10 deletions

View File

@ -12,7 +12,7 @@
- python3-botocore - python3-botocore
- python3-setuptools - python3-setuptools
become: true become: true
when: ansible_distribution == "Ubuntu" when: ansible_os_family == "Debian"
- name: Install Ansible-required packages via apk - name: Install Ansible-required packages via apk
apk: apk:
name: name:

View File

@ -13,14 +13,14 @@
groups: sudo groups: sudo
append: yes append: yes
become: yes become: yes
when: ansible_distribution == "Ubuntu" when: ansible_os_familiy == "Debian"
- name: Add user to wheel - name: Add user to wheel
user: user:
name: "{{ user_username }}" name: "{{ user_username }}"
groups: wheel groups: wheel
append: yes append: yes
become: yes become: yes
when: ansible_distribution != "Ubuntu" when: ansible_os_family != "Debian"
- name: Bootstrap user - name: Bootstrap user
block: block:
- name: Assure .ssh directory - name: Assure .ssh directory

View File

@ -12,12 +12,12 @@
user: user:
name: ansible name: ansible
groups: sudo groups: sudo
when: ansible_distribution == "Ubuntu" when: ansible_os_family == "Debian"
- name: Enroll Ansible user in wheel - name: Enroll Ansible user in wheel
user: user:
name: ansible name: ansible
groups: wheel groups: wheel
when: ansible_distribution != "Ubuntu" when: ansible_os_family != "Debian"
- name: Ensure perms on Ansible user home - name: Ensure perms on Ansible user home
file: file:
path: "/home/ansible" path: "/home/ansible"

View File

@ -16,7 +16,7 @@
- name: Set hostname - name: Set hostname
hostname: hostname:
name: "{{ inventory_hostname }}" name: "{{ inventory_hostname }}"
when: ansible_distribution == "Ubuntu" when: ansible_os_family == "Debian"
- name: Set hostname for PMOS - name: Set hostname for PMOS
hostname: hostname:
name: "{{ inventory_hostname }}" name: "{{ inventory_hostname }}"
@ -26,7 +26,7 @@
timezone: timezone:
name: "America/Chicago" name: "America/Chicago"
notify: restart cron notify: restart cron
when: ansible_distribution == "Ubuntu" when: ansible_os_family == "Debian"
- name: Configure MOTD - name: Configure MOTD
block: block:
- name: Disable MOTD news - name: Disable MOTD news
@ -49,10 +49,10 @@
- "92-unattended-upgrades" - "92-unattended-upgrades"
- "95-hwe-eol" - "95-hwe-eol"
- "97-overlayroot" - "97-overlayroot"
when: ansible_distribution == "Ubuntu" when: ansible_os_family == "Debian"
- name: Configure Ansible user - name: Configure Ansible user
include_tasks: ansibleuser.yml include_tasks: ansibleuser.yml
- name: Configure services - name: Configure services
include_tasks: services.yml include_tasks: services.yml
when: ansible_distribution == "Ubuntu" when: ansible_os_family == "Debian"
become: yes become: yes

View File

@ -31,7 +31,7 @@
name: name:
- smartmontools - smartmontools
become: yes become: yes
when: ansible_distribution == "Ubuntu" when: ansible_os_family == "Debian"
- name: Install packages via APK - name: Install packages via APK
block: block:
- name: Update and upgrade packages - name: Update and upgrade packages