Reduce output from ansible playbooks. Some minor changes.
This commit is contained in:
@ -1,19 +1,19 @@
|
||||
---
|
||||
|
||||
- hosts: o25.oopen.de
|
||||
- hosts: all
|
||||
|
||||
|
||||
tasks:
|
||||
|
||||
- name: debug print all interface ipv4 data
|
||||
when: "hostvars[ansible_fqdn]['ansible_'~item]['ipv4'] is defined"
|
||||
debug:
|
||||
msg="{{ hostvars[ansible_fqdn]['ansible_'~item]['ipv4'] | pprint }}"
|
||||
with_items:
|
||||
- "{{ ansible_interfaces | map('replace', '-','_') | list }}"
|
||||
|
||||
- name: define traditional ethernet facts
|
||||
|
||||
- name: Get sshd ports as blank separated list
|
||||
set_fact:
|
||||
ansible_eth: "{% set ansible_eth = ansible_eth|default([]) + [hostvars[inventory_hostname]['ansible_' + item]] %}{{ ansible_eth|list }}"
|
||||
when: hostvars[inventory_hostname]['ansible_' + item]['type'] == 'ether'
|
||||
with_items:
|
||||
- "{{ hostvars[inventory_hostname]['ansible_interfaces'] }}"
|
||||
fw_sshd_ports: "{{ sshd_ports | join (' ') }}"
|
||||
when:
|
||||
- sshd_ports is defined and sshd_ports | length > 0
|
||||
- sshd_ports|join() != "22"
|
||||
|
||||
- name: Set default sshd ports
|
||||
set_fact:
|
||||
fw_sshd_ports: "$standard_ssh_port"
|
||||
when:
|
||||
- sshd_ports is not defined or sshd_ports | length == 0 or sshd_ports|join() == "22"
|
||||
|
Reference in New Issue
Block a user