template/relayd.yml.j2:
# {{ ansible_managed }}
#
#
# Macros
#
carp0_ip="{{ ansible_carp0["ipv4"]["address"] }}"
webhost="{{ web_server }}"
#
# Global Options
#
interval 10
log updates
prefork 5
timeout 3000
...
# more in the relayd.conf.j2 file, is removed
the web_server comes from variable file, but the carp0_ip is pulled from
facts when the play is run
as user ansible, using sudo
and the play file: task/main.yml:
---
# file: roles/proxy_server/tasks/main.yml
# carp0 interface
- name: carp0 interface file
template: src=hostname.carp0.j2 dest=/etc/hostname.carp0 owner=root
group=wheel mode=0640
- name: install relayd.conf
template: src=relayd.conf.j2 dest=/etc/relayd.conf owner=root group=wheel
mode=0644
notify:
- restart relayd
- name: start relayd
service: name=relayd state=started
# EOF
Also one more time the snipet of the command: ansible proxy_server -m
setup (the original file was not complete(damaged))
"ansible_architecture": "amd64",
"ansible_carp0": {
"device": "carp0",
"flags": [
"UP",
"BROADCAST",
"RUNNING",
"SIMPLEX",
"MULTICAST"
],
"ipv4": [
{
"address": "10.0.0.33",
"broadcast": "10.0.0.255",
"netmask": "255.255.255.0",
"network": "10.0.0.0"
}
],
"ipv6": [
{
"address": "fe80::200:5eff:fe00:101%carp0",
"prefix": "64",
"scope": "0x4"
}
],
"macaddress": "00:00:5e:00:01:01",
"mtu": "1500",
"status": "master",
"type": "unknown"
},
"ansible_date_time":
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/fdfff820-a3e0-4290-afea-7038ae530976%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.