Replace post_* by lxc_post_*

This commit is contained in:
Dryusdan 2024-04-10 16:21:37 +02:00
parent a39579c075
commit e989b84c6a
2 changed files with 12 additions and 12 deletions

View file

@ -10,10 +10,10 @@ lxc_ipv6_network: 2002:e:a:1::0/64
lxc_ipv6_gw_addr: 2002:e:a:1::1
lxc_use_netbox: false
lxc_dns: 9.9.9.9
#post_up_ip6:
#post_down_ip6:
#post_up_ip4:
#post_down_ip4:
#lxc_post_up_ip6:
#lxc_post_down_ip6:
#lxc_post_up_ip4:
#lxc_post_down_ip4:
lxc:
- username: ipam
name: ipam

View file

@ -8,11 +8,11 @@ iface {{ lxc_ifname }} inet static
{#- The line bellow need community.general version 8.4. Disabling it -#}
{#- hwaddress ether {{ (lxc_ifhwaddr | default(community.general.random_mac(seed=inventory_hostname))) | ansible.netcommon.macaddr }} -#}
hwaddress ether {{ (lxc_ifhwaddr | default('02:ec:ca:03:aa:44')) | ansible.netcommon.macaddr }} # Generate random string with hexdump -n6 -e '6/1 ":%02x"' /dev/urandom | awk ' { sub(/^:../, "02"); print } '
{%- if post_up_ip4 is defined -%}
post-up post_up_ip4 %}
{%- if lxc_post_up_ip4 is defined -%}
post-up lxc_post_up_ip4 %}
{% endif %}
{%- if post_down_ip4 is defined -%}
post-up post_down_ip4 %}
{%- if lxc_post_down_ip4 is defined -%}
post-up lxc_post_down_ip4 %}
{% endif %}
{% endif %}
@ -20,11 +20,11 @@ iface {{ lxc_ifname }} inet static
iface {{ lxc_ifname }} inet6 static
address {{ lxc_ipv6_gw_addr | ansible.netcommon.ipv6 }}/{{ lxc_ipv6_network | ansible.netcommon.ipaddr('prefix') }}
bridge_ports none
{%- if post_up_ip6 is defined -%}
post-up post_up_ip6 %}
{%- if lxc_post_up_ip6 is defined -%}
post-up lxc_post_up_ip6 %}
{% endif %}
{%- if post_down_ip6 is defined -%}
post-up post_down_ip6 %}
{%- if lxc_post_down_ip6 is defined -%}
post-up lxc_post_down_ip6 %}
{% endif %}
{% endif %}