diff options
Diffstat (limited to 'ansible/roles/haproxy/tasks')
| -rw-r--r-- | ansible/roles/haproxy/tasks/config.yml | 50 | ||||
| -rw-r--r-- | ansible/roles/haproxy/tasks/deploy.yml | 6 | ||||
| -rw-r--r-- | ansible/roles/haproxy/tasks/main.yml | 3 | ||||
| -rw-r--r-- | ansible/roles/haproxy/tasks/precheck.yml | 1 | ||||
| -rw-r--r-- | ansible/roles/haproxy/tasks/pull.yml | 14 | ||||
| -rw-r--r-- | ansible/roles/haproxy/tasks/reconfigure.yml | 74 | ||||
| -rw-r--r-- | ansible/roles/haproxy/tasks/start.yml | 37 | ||||
| -rw-r--r-- | ansible/roles/haproxy/tasks/upgrade.yml | 19 |
8 files changed, 0 insertions, 204 deletions
diff --git a/ansible/roles/haproxy/tasks/config.yml b/ansible/roles/haproxy/tasks/config.yml deleted file mode 100644 index b23f19f3f..000000000 --- a/ansible/roles/haproxy/tasks/config.yml +++ /dev/null @@ -1,50 +0,0 @@ ---- -- name: Setting sysctl values - sysctl: name={{ item.name }} value={{ item.value }} sysctl_set=yes - with_items: - - { name: "net.ipv4.ip_nonlocal_bind", value: 1} - - { name: "net.unix.max_dgram_qlen", value: 128} - when: set_sysctl | bool - -- name: Ensuring config directories exist - file: - path: "{{ node_config_directory }}/{{ item }}" - state: "directory" - recurse: yes - with_items: - - "keepalived" - - "haproxy" - -- name: Copying over config.json files for services - template: - src: "{{ item }}.json.j2" - dest: "{{ node_config_directory }}/{{ item }}/config.json" - with_items: - - "keepalived" - - "haproxy" - -- name: Copying over haproxy.cfg - template: - src: "{{ item }}" - dest: "{{ node_config_directory }}/haproxy/haproxy.cfg" - with_first_found: - - "{{ node_custom_config }}/haproxy/{{ inventory_hostname }}/haproxy.cfg" - - "{{ node_custom_config }}/haproxy/haproxy.cfg" - - "haproxy.cfg.j2" - -- name: Copying over keepalived.conf - template: - src: "{{ item }}" - dest: "{{ node_config_directory }}/keepalived/keepalived.conf" - with_first_found: - - "{{ node_custom_config }}/keepalived/{{ inventory_hostname }}/keepalived.conf" - - "{{ node_custom_config }}/keepalived/keepalived.conf" - - "keepalived.conf.j2" - -- name: Copying over haproxy.pem - copy: - src: "{{ kolla_external_fqdn_cert }}" - dest: "{{ node_config_directory }}/haproxy/{{ item }}" - with_items: - - "haproxy.pem" - when: kolla_enable_tls_external | bool diff --git a/ansible/roles/haproxy/tasks/deploy.yml b/ansible/roles/haproxy/tasks/deploy.yml deleted file mode 100644 index ab9215b16..000000000 --- a/ansible/roles/haproxy/tasks/deploy.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -- include: config.yml - when: inventory_hostname in groups['haproxy'] - -- include: start.yml - when: inventory_hostname in groups['haproxy'] diff --git a/ansible/roles/haproxy/tasks/main.yml b/ansible/roles/haproxy/tasks/main.yml deleted file mode 100644 index 0e3f30f46..000000000 --- a/ansible/roles/haproxy/tasks/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -- include: "{{ action }}.yml" - when: inventory_hostname in groups['haproxy'] diff --git a/ansible/roles/haproxy/tasks/precheck.yml b/ansible/roles/haproxy/tasks/precheck.yml deleted file mode 100644 index ed97d539c..000000000 --- a/ansible/roles/haproxy/tasks/precheck.yml +++ /dev/null @@ -1 +0,0 @@ ---- diff --git a/ansible/roles/haproxy/tasks/pull.yml b/ansible/roles/haproxy/tasks/pull.yml deleted file mode 100644 index f00516806..000000000 --- a/ansible/roles/haproxy/tasks/pull.yml +++ /dev/null @@ -1,14 +0,0 @@ ---- -- name: Pulling keepalived image - kolla_docker: - action: "pull_image" - common_options: "{{ docker_common_options }}" - image: "{{ keepalived_image_full }}" - when: inventory_hostname in groups['haproxy'] - -- name: Pulling haproxy image - kolla_docker: - action: "pull_image" - common_options: "{{ docker_common_options }}" - image: "{{ haproxy_image_full }}" - when: inventory_hostname in groups['haproxy'] diff --git a/ansible/roles/haproxy/tasks/reconfigure.yml b/ansible/roles/haproxy/tasks/reconfigure.yml deleted file mode 100644 index ea2b3dfc0..000000000 --- a/ansible/roles/haproxy/tasks/reconfigure.yml +++ /dev/null @@ -1,74 +0,0 @@ ---- -- name: Ensuring the containers up - kolla_docker: - name: "{{ item.name }}" - action: "get_container_state" - register: container_state - failed_when: container_state.Running == false - when: inventory_hostname in groups[item.group] - with_items: - - { name: haproxy, group: haproxy } - - { name: keepalived, group: haproxy } - -- include: config.yml - -- name: Check the configs - command: docker exec {{ item.name }} /usr/local/bin/kolla_set_configs --check - changed_when: false - failed_when: false - register: check_results - when: inventory_hostname in groups[item.group] - with_items: - - { name: haproxy, group: haproxy } - - { name: keepalived, group: haproxy } - -- name: Containers config strategy - kolla_docker: - name: "{{ item.name }}" - action: "get_container_env" - register: container_envs - when: inventory_hostname in groups[item.group] - with_items: - - { name: haproxy, group: haproxy } - - { name: keepalived, group: haproxy } - -- name: Remove the containers - kolla_docker: - name: "{{ item[0]['name'] }}" - action: "remove_container" - register: remove_containers - when: - - config_strategy == "COPY_ONCE" or item[1]['KOLLA_CONFIG_STRATEGY'] == 'COPY_ONCE' - - item[2]['rc'] == 1 - - inventory_hostname in groups[item[0]['group']] - with_together: - - [{ name: haproxy, group: haproxy }, - { name: keepalived, group: haproxy }] - - "{{ container_envs.results }}" - - "{{ check_results.results }}" - -- include: start.yml - when: remove_containers.changed - -# container_envs.results is a list of two elements, first corresponds to -# haproxy container result and second to keepalived container result and the -# same applicable for check_results.results -- name: Ensuring latest haproxy config is used - command: docker exec haproxy /usr/local/bin/kolla_ensure_haproxy_latest_config - register: status - changed_when: status.stdout.find('changed') != -1 - when: - - config_strategy == 'COPY_ALWAYS' - - container_envs.results[0]['KOLLA_CONFIG_STRATEGY'] != 'COPY_ONCE' - - check_results.results[0]['rc'] == 1 - - inventory_hostname in groups['haproxy'] - -- name: Restart keepalived container - kolla_docker: - name: "keepalived" - action: "restart_container" - when: - - config_strategy == 'COPY_ALWAYS' - - container_envs.results[1]['KOLLA_CONFIG_STRATEGY'] != 'COPY_ONCE' - - check_results.results[1]['rc'] == 1 - - inventory_hostname in groups['haproxy'] diff --git a/ansible/roles/haproxy/tasks/start.yml b/ansible/roles/haproxy/tasks/start.yml deleted file mode 100644 index 692de8591..000000000 --- a/ansible/roles/haproxy/tasks/start.yml +++ /dev/null @@ -1,37 +0,0 @@ ---- -- name: Starting haproxy container - kolla_docker: - action: "start_container" - common_options: "{{ docker_common_options }}" - image: "{{ haproxy_image_full }}" - name: "haproxy" - privileged: True - volumes: - - "{{ node_config_directory }}/haproxy/:{{ container_config_directory }}/:ro" - - "/etc/localtime:/etc/localtime:ro" - - "haproxy_socket:/var/lib/kolla/haproxy/" - - "heka_socket:/var/lib/kolla/heka/" - -- name: Starting keepalived container - kolla_docker: - action: "start_container" - common_options: "{{ docker_common_options }}" - image: "{{ keepalived_image_full }}" - name: "keepalived" - privileged: True - volumes: - - "{{ node_config_directory }}/keepalived/:{{ container_config_directory }}/:ro" - - "/etc/localtime:/etc/localtime:ro" - - "/lib/modules:/lib/modules:ro" - - "haproxy_socket:/var/lib/kolla/haproxy/" - - "heka_socket:/var/lib/kolla/heka/" - -- name: Ensuring latest haproxy config is used - command: docker exec haproxy /usr/local/bin/kolla_ensure_haproxy_latest_config - register: status - changed_when: status.stdout.find('changed') != -1 - -- name: Waiting for virtual IP to appear - wait_for: - host: "{{ kolla_internal_vip_address }}" - port: "{{ database_port }}" diff --git a/ansible/roles/haproxy/tasks/upgrade.yml b/ansible/roles/haproxy/tasks/upgrade.yml deleted file mode 100644 index ce1adcfa3..000000000 --- a/ansible/roles/haproxy/tasks/upgrade.yml +++ /dev/null @@ -1,19 +0,0 @@ ---- -- include: config.yml - -- set_fact: secondary_addresses={{ hostvars[inventory_hostname]['ansible_' + api_interface].get('ipv4_secondaries', []) | map(attribute='address') | list }} - -- name: Stopping all slave keepalived containers - kolla_docker: - action: "stop_container" - common_options: "{{ docker_common_options }}" - name: "keepalived" - when: kolla_internal_vip_address not in secondary_addresses - -# Upgrading master keepalived and haproxy -- include: start.yml - when: kolla_internal_vip_address in secondary_addresses - -# Upgrading slave keepalived and haproxy -- include: start.yml - when: kolla_internal_vip_address not in secondary_addresses |
