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-setuptools
become: true
when: ansible_distribution == "Ubuntu"
when: ansible_os_family == "Debian"
- name: Install Ansible-required packages via apk
apk:
name:

View File

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

View File

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

View File

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

View File

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