Skip to content

Commit

Permalink
motd bug in default_ipv4 method from facts
Browse files Browse the repository at this point in the history
  • Loading branch information
imp1sh committed Jan 26, 2024
1 parent 805ea66 commit be4e3c3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
namespace: imp1sh
name: ansible_managemynetwork
version: 0.4.3
version: 0.4.4
readme: README.md
authors:
- Jochen Demmer <[email protected]>
Expand Down
12 changes: 6 additions & 6 deletions roles/ansible_motd/templates/motd
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
_ __ ___ _ __ _ ___ _ __ ___| |___ _____ _ __| | _____
| '_ \ / _ \| '__| / __| | '_ \ / _ \ __\ \ /\ / / _ \| '__| |/ / __|
| | | | (_) | | | \__ \ | | | | __/ |_ \ V V / (_) | | | <\__ \
|_| |_|\___/|_| |_|___/ |_| |_|\___|\__| \_/\_/ \___/|_| |_|\_\___/
|_| |_|\___/|_| |_|___/ |_| |_|\___|\__| \_/\_/ \___/|_| |_|\_\___

{% else %}
___ _ __ __
Expand Down Expand Up @@ -71,16 +71,16 @@ IPv6 address: {{ nb_vms[inventory_hostname]["primary_ip6"] }}
IPv6 address: {{ nb_devices[inventory_hostname]["primary_ip6"] }}
{% elif primary_ip6 is defined %}
IPv6 address: {{ primary_ip6 }}
{% else %}
IPv6 address: {{ ansible_facts['ansible_default_ipv6']['address'] }}/{{ ansible_facts['ansible_default_ipv6']['prefix'] }}
{% elif ansible_facts['default_ipv6']['address'] is defined %}
IPv6 address: {{ ansible_facts['default_ipv6']['address'] }}/{{ ansible_facts['default_ipv6']['prefix'] }}
{% endif %}
{% if nb_vms[inventory_hostname]["primary_ip4"] is defined %}
{% if nb_vms[inventory_hostname]["primary_ip4"]['address'] is defined %}
IPv4 address: {{ nb_vms[inventory_hostname]["primary_ip4"] }}
{% elif nb_devices[inventory_hostname]["primary_ip4"] is defined %}
IPv4 address: {{ nb_devices[inventory_hostname]["primary_ip4"] }}
{% elif primary_ip4 is defined %}
IPv4 address: {{ primary_ip4 }}
{% else %}
IPv4 address: {{ ansible_facts['ansible_default_ipv4']['address'] }}/{{ ansible_facts['ansible_default_ipv4']['prefix'] }}
{% elif ansible_facts['default_ipv4']['address'] is defined %}
IPv4 address: {{ ansible_facts['default_ipv4']['address'] }}/{{ ansible_facts['default_ipv4']['prefix'] }}
{% endif %}
timezone: {{ ansible_date_time['tz'] }}

0 comments on commit be4e3c3

Please sign in to comment.