Add 'Ubuntu LTS Release validation'
This commit is contained in:
1 parent
651e52d194
commit
6b1e5bb9bd
4 files changed
+30
-4
No files matched your search
@@ -13,6 +13,5 @@ galaxy_info:
|
|||||||
galaxy_tags:
|
galaxy_tags:
|
||||||
- system
|
- system
|
||||||
- ubuntu
|
- ubuntu
|
||||||
- ubuntu-pro
|
|
||||||
|
|
||||||
dependencies: []
|
dependencies: []
|
||||||
+6
-3
@@ -1,4 +1,6 @@
|
|||||||
---
|
---
|
||||||
|
- include_tasks: validate_ubuntu_lts_version.yml
|
||||||
|
|
||||||
- name: Launch 'apt update'
|
- name: Launch 'apt update'
|
||||||
ansible.builtin.apt:
|
ansible.builtin.apt:
|
||||||
update_cache: yes
|
update_cache: yes
|
||||||
@@ -8,11 +10,12 @@
|
|||||||
ansible.builtin.apt:
|
ansible.builtin.apt:
|
||||||
upgrade: yes
|
upgrade: yes
|
||||||
become: yes
|
become: yes
|
||||||
|
|
||||||
- name: Register this host on Ubuntu Pro (pro attach <token>)
|
- 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
|
become: yes
|
||||||
register: reg_pro_attach
|
register: reg_pro_attach
|
||||||
|
|
||||||
- debug:
|
- name: Print 'pro attach' command output
|
||||||
|
ansible.builtin.debug:
|
||||||
var: reg_pro_attach
|
var: reg_pro_attach
|
||||||
@@ -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'
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
ubuntu_pro_lts_releases:
|
||||||
|
- "16.04"
|
||||||
|
- "18.04"
|
||||||
|
- "20.04"
|
||||||
|
- "22.04"
|
||||||
Reference in new issue
Block a user