Skip to content

Commit 0d17537

Browse files
committed
fix: Ansible facts pull for specific Ubuntu version
1 parent c6e8b49 commit 0d17537

File tree

5 files changed

+24
-24
lines changed

5 files changed

+24
-24
lines changed

ansible/roles/config/tasks/main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
- always
2121

2222
# Include OS-specific variables
23-
- name: "[Software] Include OS group_vars {{ facter_os.name }}-{{ facter_os.release.major }}"
23+
- name: "[Config] Include OS group_vars Ubuntu-{{ ansible_facts.distribution_major_version }}"
2424
ansible.builtin.include_vars: "{{ item }}"
2525
with_first_found:
2626
- files:
27-
- "{{ playbook_dir }}/group_vars/{{ facter_os.name | lower }}-{{ facter_os.release.major }}.yml"
28-
skip: true
27+
- "{{ playbook_dir }}/group_vars/ubuntu-{{ ansible_facts.distribution_major_version }}.yml"
28+
skip: false
2929
tags:
3030
- always
3131

ansible/roles/software/tasks/main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@
2424
- always
2525

2626
# Include OS-specific variables
27-
- name: "[Software] Include OS group_vars {{ facter_os.name }}-{{ facter_os.release.major }}"
27+
- name: "[Software] Include OS group_vars Ubuntu-{{ ansible_facts.distribution_major_version }}"
2828
ansible.builtin.include_vars: "{{ item }}"
2929
with_first_found:
3030
- files:
31-
- "{{ playbook_dir }}/group_vars/{{ facter_os.name | lower }}-{{ facter_os.release.major }}.yml"
32-
skip: true
31+
- "{{ playbook_dir }}/group_vars/ubuntu-{{ ansible_facts.distribution_major_version }}.yml"
32+
skip: false
3333
tags:
3434
- always
3535

ansible/setup-ubuntu.yml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,31 @@
33
### Comment out roles you don't need ###
44
vars:
55
summary: |
6-
#############################################
6+
#############################################
77
8-
Thank you for using
9-
___ _
10-
/ _ \_ __ _____ _____ __ _ ___(_) ___
11-
/ /_)/ '__/ _ \ \ / / _ \/ _` / __| |/ _ \
12-
/ ___/| | | (_) \ V / __/ (_| \__ \ | (_) |
13-
\/ |_| \___/ \_/ \___|\__,_|___/_|\___/
8+
Thank you for using
9+
___ _
10+
/ _ \_ __ _____ _____ __ _ ___(_) ___
11+
/ /_)/ '__/ _ \ \ / / _ \/ _` / __| |/ _ \
12+
/ ___/| | | (_) \ V / __/ (_| \__ \ | (_) |
13+
\/ |_| \___/ \_/ \___|\__,_|___/_|\___/
1414
15-
For example usages see `Usages.md`.
15+
For example usages see `Usages.md`.
1616
17-
IF you like it, gimme a star! :)
17+
IF you like it, gimme a star! :)
1818
19-
#############################################
19+
#############################################
2020
21-
This ansible run ended up with below versions installed/upgraded:
21+
This ansible run ended up with below versions installed/upgraded:
2222
2323
24-
{{ current_versions | to_nice_yaml }}
24+
{{ current_versions | to_nice_yaml }}
2525
26-
All above versions are added/updated in `{{ playbook_dir }}/../current-versions.yml`
26+
All above versions are added/updated in `{{ playbook_dir }}/../current-versions.yml`
2727
28-
See `README.md` for details on versioning.
28+
See `README.md` for details on versioning.
2929
tasks:
30-
- name: '[Init] Check sudo password'
30+
- name: "[Init] Check sudo password"
3131
ansible.builtin.command: echo "sudo password is correct"
3232
become: true
3333
changed_when: false
@@ -43,14 +43,14 @@
4343
- name: "[Init] Ensure `current-versions.yml` file"
4444
ansible.builtin.file:
4545
path: "{{ playbook_dir }}/../current-versions.yml"
46-
mode: '0644'
46+
mode: "0644"
4747
state: touch
4848
tags:
4949
- always
50-
- name: '[Software] Include software role'
50+
- name: "[Software] Include software role"
5151
ansible.builtin.import_role:
5252
name: software
53-
- name: '[Config] Include config role'
53+
- name: "[Config] Include config role"
5454
ansible.builtin.import_role:
5555
name: config
5656
- name: "[Summary] Show detailed info"

0 commit comments

Comments
 (0)