File: report_targets.yml

package info (click to toggle)
python-mitogen 0.3.37-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,728 kB
  • sloc: python: 24,644; sh: 198; makefile: 74; perl: 19; ansic: 18
file content (35 lines) | stat: -rw-r--r-- 1,072 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
- name: Report target facts
  hosts: localhost:test-targets
  gather_facts: true
  tasks:
    - debug: {var: ansible_facts.distribution}
    - debug: {var: ansible_facts.distribution_major_version}
    - debug: {var: ansible_facts.distribution_release}
    - debug: {var: ansible_facts.distribution_version}
    - debug: {var: ansible_facts.kernel}
    - debug: {var: ansible_facts.kernel_version}
    - debug: {var: ansible_facts.os_family}
    - debug: {var: ansible_facts.osrevision}
    - debug: {var: ansible_facts.osversion}
    - debug: {var: ansible_facts.python}
    - debug: {var: ansible_facts.system}

- name: Check target versions
  hosts: localhost:test-targets
  check_mode: false
  tasks:
    - name: Get command versions
      command:
        cmd: "{{ item.cmd }}"
      changed_when: false
      check_mode: false
      loop:
        - cmd: sudo -V
      register: command_versions

    - name: Show command versions
      debug:
        msg: |
          cmd: {{ item.item.cmd }}
          {{ item.stdout }}
      loop: "{{ command_versions.results }}"