Skip to content

Commit

Permalink
fix: Ansible facts pull for specific Ubuntu version
Browse files Browse the repository at this point in the history
  • Loading branch information
Ziwi01 committed Sep 7, 2024
1 parent c6e8b49 commit 0d17537
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 24 deletions.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions ansible/roles/config/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
- always

# Include OS-specific variables
- name: "[Software] Include OS group_vars {{ facter_os.name }}-{{ facter_os.release.major }}"
- name: "[Config] Include OS group_vars Ubuntu-{{ ansible_facts.distribution_major_version }}"
ansible.builtin.include_vars: "{{ item }}"
with_first_found:
- files:
- "{{ playbook_dir }}/group_vars/{{ facter_os.name | lower }}-{{ facter_os.release.major }}.yml"
skip: true
- "{{ playbook_dir }}/group_vars/ubuntu-{{ ansible_facts.distribution_major_version }}.yml"
skip: false
tags:
- always

Expand Down
6 changes: 3 additions & 3 deletions ansible/roles/software/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
- always

# Include OS-specific variables
- name: "[Software] Include OS group_vars {{ facter_os.name }}-{{ facter_os.release.major }}"
- name: "[Software] Include OS group_vars Ubuntu-{{ ansible_facts.distribution_major_version }}"
ansible.builtin.include_vars: "{{ item }}"
with_first_found:
- files:
- "{{ playbook_dir }}/group_vars/{{ facter_os.name | lower }}-{{ facter_os.release.major }}.yml"
skip: true
- "{{ playbook_dir }}/group_vars/ubuntu-{{ ansible_facts.distribution_major_version }}.yml"
skip: false
tags:
- always

Expand Down
36 changes: 18 additions & 18 deletions ansible/setup-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,31 @@
### Comment out roles you don't need ###
vars:
summary: |
#############################################
#############################################
Thank you for using
___ _
/ _ \_ __ _____ _____ __ _ ___(_) ___
/ /_)/ '__/ _ \ \ / / _ \/ _` / __| |/ _ \
/ ___/| | | (_) \ V / __/ (_| \__ \ | (_) |
\/ |_| \___/ \_/ \___|\__,_|___/_|\___/
Thank you for using
___ _
/ _ \_ __ _____ _____ __ _ ___(_) ___
/ /_)/ '__/ _ \ \ / / _ \/ _` / __| |/ _ \
/ ___/| | | (_) \ V / __/ (_| \__ \ | (_) |
\/ |_| \___/ \_/ \___|\__,_|___/_|\___/
For example usages see `Usages.md`.
For example usages see `Usages.md`.
IF you like it, gimme a star! :)
IF you like it, gimme a star! :)
#############################################
#############################################
This ansible run ended up with below versions installed/upgraded:
This ansible run ended up with below versions installed/upgraded:
{{ current_versions | to_nice_yaml }}
{{ current_versions | to_nice_yaml }}
All above versions are added/updated in `{{ playbook_dir }}/../current-versions.yml`
All above versions are added/updated in `{{ playbook_dir }}/../current-versions.yml`
See `README.md` for details on versioning.
See `README.md` for details on versioning.
tasks:
- name: '[Init] Check sudo password'
- name: "[Init] Check sudo password"
ansible.builtin.command: echo "sudo password is correct"
become: true
changed_when: false
Expand All @@ -43,14 +43,14 @@
- name: "[Init] Ensure `current-versions.yml` file"
ansible.builtin.file:
path: "{{ playbook_dir }}/../current-versions.yml"
mode: '0644'
mode: "0644"
state: touch
tags:
- always
- name: '[Software] Include software role'
- name: "[Software] Include software role"
ansible.builtin.import_role:
name: software
- name: '[Config] Include config role'
- name: "[Config] Include config role"
ansible.builtin.import_role:
name: config
- name: "[Summary] Show detailed info"
Expand Down

0 comments on commit 0d17537

Please sign in to comment.