Browse Source

enough: remove docker driver leftovers

keep-around/68a3c3746a6b9a97ade4ac05826340644ed27ed2
Loïc Dachary 6 months ago
committed by some
parent
commit
0758809420
Signed by: dachary GPG Key ID: 992D23B392F9E4F2
  1. 1
      inventory/group_vars/all/infrastructure.yml
  2. 1
      playbooks/bind/bind-client-dhcp-playbook.yml
  3. 87
      playbooks/bind/roles/dhclient/tasks/main.yml
  4. 3
      playbooks/bind/roles/dhclient/templates/resolv.conf.j2
  5. 6
      playbooks/chat/chat-playbook.yml
  6. 1
      playbooks/infrastructure/roles/docker/tasks/main.yml

1
inventory/group_vars/all/infrastructure.yml

@ -2,5 +2,4 @@
#
# Server provisioning infrastructure
#
# infrastructure_driver: docker
infrastructure_driver: openstack

1
playbooks/bind/bind-client-dhcp-playbook.yml

@ -16,6 +16,5 @@
# the name resolution will fail and sudo will timeout
#
- name: set hostname
when: infrastructure_driver == 'openstack'
hostname:
name: '{{ inventory_hostname }}.{{ domain }}'

87
playbooks/bind/roles/dhclient/tasks/main.yml

@ -1,55 +1,40 @@
---
- when: infrastructure_driver == 'openstack'
block:
#
# The following is only necessary for backward compatibility. Once all Enough
# instances have a separate dhclient_routers.conf for the secondary
# interface, it can be removed, as well as the template.
#
- name: setup dhclient.conf
template:
src: dhclient.conf.j2
dest: /etc/dhcp/dhclient.conf
register: dhclient
#
# The following is only necessary for backward compatibility. Once all Enough
# instances have a separate dhclient_routers.conf for the secondary
# interface, it can be removed, as well as the template.
#
- name: setup dhclient.conf
template:
src: dhclient.conf.j2
dest: /etc/dhcp/dhclient.conf
register: dhclient
#
# The following is necessary if the host was not created by Enough
# because it is created by playbooks/infrastructure/template-host.yaml
#
- name: touch /etc/dhcp/dhclient_routers.conf
file:
path: /etc/dhcp/dhclient_routers.conf
state: touch
mode: 0644
#
# The following is necessary if the host was not created by Enough
# because it is created by playbooks/infrastructure/template-host.yaml
#
- name: touch /etc/dhcp/dhclient_routers.conf
file:
path: /etc/dhcp/dhclient_routers.conf
state: touch
mode: 0644
- name: setup dhclient_routers.conf
blockinfile:
block: |
supersede domain-name "{{ dns_domain }}";
supersede domain-search "{{ dns_domain }}";
supersede domain-name-servers {{ bind_server_ip_for_clients }};
path: /etc/dhcp/dhclient_routers.conf
marker: "# {mark} Enough"
register: dhclient_routers
- name: setup dhclient_routers.conf
blockinfile:
block: |
supersede domain-name "{{ dns_domain }}";
supersede domain-search "{{ dns_domain }}";
supersede domain-name-servers {{ bind_server_ip_for_clients }};
path: /etc/dhcp/dhclient_routers.conf
marker: "# {mark} Enough"
register: dhclient_routers
- name: restart all interfaces to reload dhclient.conf and update /etc/resolv.conf
shell: |
set -ex
ifdown {{ network_primary_interface }}
ifup {{ network_primary_interface }}
ifdown {{ network_secondary_interface }} || true
ifup {{ network_secondary_interface }} || true
when: dhclient is changed or dhclient_routers is changed
- when: infrastructure_driver == 'docker'
block:
- name: setup resolv.conf
template:
src: resolv.conf.j2
# copying directly to /etc/resolv.conf won't work because it is bind mounted by docker
dest: /tmp/resolv.conf
- name: copy to resolv.conf
shell: |
cat /tmp/resolv.conf > /etc/resolv.conf
- name: restart all interfaces to reload dhclient.conf and update /etc/resolv.conf
shell: |
set -ex
ifdown {{ network_primary_interface }}
ifup {{ network_primary_interface }}
ifdown {{ network_secondary_interface }} || true
ifup {{ network_secondary_interface }} || true
when: dhclient is changed or dhclient_routers is changed

3
playbooks/bind/roles/dhclient/templates/resolv.conf.j2

@ -1,3 +0,0 @@
search {{ dns_domain }}
nameserver {{ bind_server_ip_for_clients }}
nameserver 127.0.0.11

6
playbooks/chat/chat-playbook.yml

@ -5,10 +5,8 @@
pre_tasks:
- when: infrastructure_driver == 'openstack'
block:
- include_role:
name: ansible-role-docker
- include_role:
name: ansible-role-docker
roles:
- role: docker

1
playbooks/infrastructure/roles/docker/tasks/main.yml

@ -17,7 +17,6 @@
meta: reset_connection
- name: docker network create {{ domain }}
when: infrastructure_driver == 'openstack'
docker_network:
name: "{{ domain }}"
ipam_options:

Loading…
Cancel
Save