diff options
| author | boom2 <blizzack@blizzack.com> | 2023-12-21 15:49:16 -0500 |
|---|---|---|
| committer | boom2 <blizzack@blizzack.com> | 2023-12-21 15:49:16 -0500 |
| commit | 200680e7c8cbd6b4426c3ce232568b1e06446bde (patch) | |
| tree | b122f103cc4dce8cea078c20dac107612399640e /ansible-practice/system/16-playbook-test-slackware-version.yml | |
| parent | a21b2f4bb64bd0f633d8a6a15f27a73103df70c0 (diff) | |
- renamed playbook to follow convention
-- add /etc/rc.d/rc.M in 'fetch file playbook' for future clamav playbook
Diffstat (limited to 'ansible-practice/system/16-playbook-test-slackware-version.yml')
| -rw-r--r-- | ansible-practice/system/16-playbook-test-slackware-version.yml | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/ansible-practice/system/16-playbook-test-slackware-version.yml b/ansible-practice/system/16-playbook-test-slackware-version.yml new file mode 100644 index 0000000..ed19c03 --- /dev/null +++ b/ansible-practice/system/16-playbook-test-slackware-version.yml @@ -0,0 +1,52 @@ +# test slackware version on host w/ conditonals +# +# - use cases: +# - set conditions depending on the version +# +--- +- name: "16 - custom ansible - test slackware version" + hosts: dev + + tasks: + - name: Print os info + ansible.builtin.debug: + msg: + - "distro = {{ ansible_distribution }}" + - "distro major version = {{ ansible_distribution_major_version }}" + - "distro release = {{ ansible_distribution_release }}" + - "distro version = {{ ansible_distribution_version }}" + + - name: is os version '-current' + ansible.builtin.debug: + msg: this slackware distro is '-current ! + when: + - ansible_facts['distribution'] == "Slackware" + - ansible_facts['distribution_release'] == "current" + tags: ['is_current'] + + - name: os version is not '-current' + ansible.builtin.debug: + msg: this slackware distro is NOT '-current ! + when: + - ansible_facts['distribution'] == "Slackware" + - ansible_facts['distribution_release'] != "current" + tags: ['is_not_current'] + + +# "ansible_distribution": "Slackware", +# "ansible_distribution_major_version": "15", +# "ansible_distribution_release": "current", +# "ansible_distribution_version": "15.0+", +# +# +# "ansible_distribution": "Slackware", +# "ansible_distribution_major_version": "15", +# "ansible_distribution_release": "stable", +# "ansible_distribution_version": "15.0", + + +# References +# +# https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_conditionals.html +# +# |
