diff --git a/playbooks/roles/system/gateway_hosts/defaults/main.yml b/playbooks/roles/system/gateway_hosts/defaults/main.yml new file mode 100644 index 0000000..02199ad --- /dev/null +++ b/playbooks/roles/system/gateway_hosts/defaults/main.yml @@ -0,0 +1,3 @@ +system_gateway_hosts_files: + - "/etc/hosts" +system_gateway_hosts_hosts: {} diff --git a/playbooks/roles/system/gateway_hosts/meta/argument_specs.yml b/playbooks/roles/system/gateway_hosts/meta/argument_specs.yml new file mode 100644 index 0000000..80e2c0a --- /dev/null +++ b/playbooks/roles/system/gateway_hosts/meta/argument_specs.yml @@ -0,0 +1,15 @@ +--- +argument_specs: + main: + options: + ansible_hostname: + type: "str" + required: true + system_gateway_hosts_files: + type: "list" + elem: "str" + required: false + system_gateway_hosts_hosts: + type: "dict" + elem: "str" + required: false diff --git a/playbooks/roles/system/gateway_hosts/tasks/main.yml b/playbooks/roles/system/gateway_hosts/tasks/main.yml new file mode 100644 index 0000000..262c6ff --- /dev/null +++ b/playbooks/roles/system/gateway_hosts/tasks/main.yml @@ -0,0 +1,12 @@ +--- +- name: "configure name resolution" + ansible.builtin.blockinfile: + path: "{{ item[0] }}" + insertbefore: "EOF" + marker: "# {mark} ANSIBLE MANAGED BLOCK SYSTEM {{ item[1].key }} #" + block: | + {{ item[1].value.inet }} {{ item[1].key }} + {{ item[1].value.inet6 }} {{ item[1].key }} + with_nested: + - "{{ system_gateway_hosts_files }}" + - "{{ system_gateway_hosts_hosts | dict2items }}" diff --git a/playbooks/system.yml b/playbooks/system.yml index 1b38489..ced290c 100644 --- a/playbooks/system.yml +++ b/playbooks/system.yml @@ -37,6 +37,20 @@ - role: "system/zfs" tags: "system:zfs" +- name: "system : valkyrie" + hosts: "valkyrie" + roles: + - role: "system/gateway_hosts" + tags: "system:gateway_hosts" + vars: + system_gateway_hosts_files: + - "/etc/hosts" + - "/etc/cloud/templates/hosts.debian.tmpl" + system_gateway_hosts_hosts: + "git.thenineworlds.net": + "inet": "{{ hostvars.valkyrie.services_host_services.rproxy.inet_address }}" + "inet6": "{{ hostvars.valkyrie.services_host_services.rproxy.inet6_address }}" + - name: "system : all" hosts: "all" roles: