Merge pull request #3 from sebthebert/dev_validate_ubuntu_lts_release

Add 'Ubuntu LTS Release validation'
This commit is contained in:
Sebastien Thebert authored and GitHub committed 2022-10-11 16:12:38 +02:00
commit ddf3d70b9a
4 files changed
+30 -4

No files matched your search

-1
View File
@@ -13,6 +13,5 @@ galaxy_info:
galaxy_tags:
- system
- ubuntu
- ubuntu-pro
dependencies: []
+6 -3
View File
@@ -1,4 +1,6 @@
---
- include_tasks: validate_ubuntu_lts_version.yml
- name: Launch 'apt update'
ansible.builtin.apt:
update_cache: yes
@@ -8,11 +10,12 @@
ansible.builtin.apt:
upgrade: yes
become: yes
- name: Register this host on Ubuntu Pro (pro attach <token>)
command: pro attach {{ ubuntu_pro_token }}
ansible.builtin.command: "pro attach {{ ubuntu_pro_token }}"
become: yes
register: reg_pro_attach
- debug:
- name: Print 'pro attach' command output
ansible.builtin.debug:
var: reg_pro_attach
+18
View File
@@ -0,0 +1,18 @@
---
- name: Gather LSB Facts
ansible.builtin.setup:
filter: lsb
- name: Assert that Host Operating System is Ubuntu
ansible.builtin.assert:
that:
- ansible_facts.lsb.id == 'Ubuntu'
fail_msg: 'Host Operating System is NOT Ubuntu'
success_msg: 'Host Operating System is Ubuntu'
- name: Assert that Host Operating System is an Ubuntu LSB Release
ansible.builtin.assert:
that:
- ansible_facts.lsb.release in ubuntu_pro_lts_releases
fail_msg: 'Host Operating System is NOT an Ubuntu LSB Release'
success_msg: 'Host Operating System is an Ubuntu LSB Release'
+6
View File
@@ -0,0 +1,6 @@
---
ubuntu_pro_lts_releases:
- "16.04"
- "18.04"
- "20.04"
- "22.04"