Skip to content
Snippets Groups Projects
Commit be3ea1ca authored by Dónal Cunningham's avatar Dónal Cunningham
Browse files

DC - reorganised the show version playbooks

parent 6d1d0033
Branches
Tags
No related merge requests found
Showing
with 9 additions and 38 deletions
--- ---
- name: Play 1 - Show the software version on an Arista switch - name: Play 1 - Show the software version on an Arista switch
hosts: veos_hosts hosts: veos_hosts
gather_facts: "no" gather_facts: no
connection: local connection: local
tasks: tasks:
- name: Task 1.1 - Gather version from switches using the raw module - name: Task 1.1 - Gather version from switches using the raw module
......
--- ---
- name: Play 1 - Show the software version on an Arista switch - name: Play 1 - Show the software version on an Arista switch
hosts: veos_hosts hosts: veos_hosts
gather_facts: "no" gather_facts: no
connection: local connection: local
tasks: tasks:
- name: Task 1.1 - Gather version from switches - name: Task 1.1 - Gather version from switches
......
--- ---
- name: Play 1 - Show the software version on a vSRX - name: Play 1 - Show the software version on a vSRX
hosts: vSRX hosts: vSRX
gather_facts: "no" gather_facts: no
connection: local connection: local
tasks: tasks:
- name: Task 1.1 - Gather version from switches - name: Task 1.1 - Gather version from switches
......
---
- name: Play 1 - Show the software version on an Arista switch
hosts: veos
gather_facts: "no"
connection: local
tasks:
- name: Task 1.1 - Gather version from switches
raw: 'show version | include Software'
register: showvers
- name: Task 1.2 - Print output
debug: var=showvers.stdout_lines[0]
- name: Play 2 - Verify switch software
hosts: veos
vars:
eos_version: "4.25"
gather_facts: "no"
connection: local
tasks:
- name: Task 2.1 - Assert we are running the correct EOS version ({{eos_version}})
assert:
that:
- "'{{eos_version}}' in showvers.stdout_lines[0]"
msg: "Oh noes! Switch not running eOS {{eos_version}}!"
---
- name: Check the version of code on a switch
hosts: veos
gather_facts: no # or False
tasks:
- name: Gather version from switches
raw: ‘show version’
register: show_version
--- ---
# Oh look, a comment… # Oh look, a comment…
# …spread out over multiple lines # …spread out over multiple lines
# This is not a real playbook - please do not attempt to run it.
# If you do it anyway, you will get this error:
# "ERROR! no module/action detected in task."
- name: Set up Apache # Or nginx, or Mongoose - name: Set up Apache # Or nginx, or Mongoose
hosts: webservers hosts: webservers
tasks: tasks:
...@@ -8,4 +13,4 @@ ...@@ -8,4 +13,4 @@
- name: generate Apache config file - name: generate Apache config file
- name: download Web content to relevant directory - name: download Web content to relevant directory
- name: restart Apache - name: restart Apache
- name: eat cake - name: eat cake
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment