diff options
Diffstat (limited to 'ansible/roles/horizon/tasks')
| -rw-r--r-- | ansible/roles/horizon/tasks/bootstrap.yml | 41 | ||||
| -rw-r--r-- | ansible/roles/horizon/tasks/bootstrap_service.yml | 19 | ||||
| -rw-r--r-- | ansible/roles/horizon/tasks/config.yml | 33 | ||||
| -rw-r--r-- | ansible/roles/horizon/tasks/deploy.yml | 9 | ||||
| -rw-r--r-- | ansible/roles/horizon/tasks/main.yml | 2 | ||||
| -rw-r--r-- | ansible/roles/horizon/tasks/precheck.yml | 1 | ||||
| -rw-r--r-- | ansible/roles/horizon/tasks/pull.yml | 7 | ||||
| -rw-r--r-- | ansible/roles/horizon/tasks/reconfigure.yml | 64 | ||||
| -rw-r--r-- | ansible/roles/horizon/tasks/register.yml | 13 | ||||
| -rw-r--r-- | ansible/roles/horizon/tasks/start.yml | 14 | ||||
| -rw-r--r-- | ansible/roles/horizon/tasks/upgrade.yml | 4 |
11 files changed, 0 insertions, 207 deletions
diff --git a/ansible/roles/horizon/tasks/bootstrap.yml b/ansible/roles/horizon/tasks/bootstrap.yml deleted file mode 100644 index 6e6127495..000000000 --- a/ansible/roles/horizon/tasks/bootstrap.yml +++ /dev/null @@ -1,41 +0,0 @@ ---- -- name: Creating Horizon database - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m mysql_db - -a "login_host='{{ database_address }}' - login_port='{{ database_port }}' - login_user='{{ database_user }}' - login_password='{{ database_password }}' - name='{{ horizon_database_name }}'" - register: database - changed_when: "{{ database.stdout.find('localhost | SUCCESS => ') != -1 and - (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - failed_when: database.stdout.split()[2] != 'SUCCESS' - run_once: True - delegate_to: "{{ groups['horizon'][0] }}" - -- name: Reading json from variable - set_fact: - database_created: "{{ (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - -- name: Creating Horizon database user and setting permissions - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m mysql_user - -a "login_host='{{ database_address }}' - login_port='{{ database_port }}' - login_user='{{ database_user }}' - login_password='{{ database_password }}' - name='{{ horizon_database_name }}' - password='{{ horizon_database_password }}' - host='%' - priv='{{ horizon_database_name }}.*:ALL' - append_privs='yes'" - register: database_user_create - changed_when: "{{ database_user_create.stdout.find('localhost | SUCCESS => ') != -1 and - (database_user_create.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - failed_when: database_user_create.stdout.split()[2] != 'SUCCESS' - run_once: True - delegate_to: "{{ groups['horizon'][0] }}" - -- include: bootstrap_service.yml - when: database_created diff --git a/ansible/roles/horizon/tasks/bootstrap_service.yml b/ansible/roles/horizon/tasks/bootstrap_service.yml deleted file mode 100644 index c20280f6b..000000000 --- a/ansible/roles/horizon/tasks/bootstrap_service.yml +++ /dev/null @@ -1,19 +0,0 @@ ---- -- name: Running Horizon bootstrap container - kolla_docker: - action: "start_container" - common_options: "{{ docker_common_options }}" - detach: False - environment: - KOLLA_BOOTSTRAP: - KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" - image: "{{ horizon_image_full }}" - labels: - BOOTSTRAP: - name: "bootstrap_horizon" - restart_policy: "never" - volumes: - - "{{ node_config_directory }}/horizon/:{{ container_config_directory }}/:ro" - - "kolla_logs:/var/log/kolla/" - run_once: True - delegate_to: "{{ groups['horizon'][0] }}" diff --git a/ansible/roles/horizon/tasks/config.yml b/ansible/roles/horizon/tasks/config.yml deleted file mode 100644 index c361c8352..000000000 --- a/ansible/roles/horizon/tasks/config.yml +++ /dev/null @@ -1,33 +0,0 @@ ---- -- name: Ensuring config directories exist - file: - path: "{{ node_config_directory }}/{{ item }}" - state: "directory" - recurse: yes - with_items: - - "horizon" - -- name: Copying over config.json files for services - template: - src: "{{ item }}.json.j2" - dest: "{{ node_config_directory }}/{{ item }}/config.json" - with_items: - - "horizon" - -- name: Copying over horizon.conf - template: - src: "{{ item }}" - dest: "{{ node_config_directory }}/horizon/horizon.conf" - with_first_found: - - "{{ node_custom_config }}/horizon/{{ inventory_hostname }}/horizon.conf" - - "{{ node_custom_config }}/horizon/horizon.conf" - - "horizon.conf.j2" - -- name: Copying over local_settings - template: - src: "{{ item }}" - dest: "{{ node_config_directory }}/horizon/local_settings" - with_first_found: - - "{{ node_custom_config }}/horizon/{{ inventory_hostname }}/local_settings" - - "{{ node_custom_config }}/horizon/local_settings" - - "local_settings.j2" diff --git a/ansible/roles/horizon/tasks/deploy.yml b/ansible/roles/horizon/tasks/deploy.yml deleted file mode 100644 index 3c04e136d..000000000 --- a/ansible/roles/horizon/tasks/deploy.yml +++ /dev/null @@ -1,9 +0,0 @@ ---- -- include: config.yml - -- include: register.yml - -- include: bootstrap.yml - when: horizon_backend_database | bool - -- include: start.yml diff --git a/ansible/roles/horizon/tasks/main.yml b/ansible/roles/horizon/tasks/main.yml deleted file mode 100644 index b017e8b4a..000000000 --- a/ansible/roles/horizon/tasks/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -- include: "{{ action }}.yml" diff --git a/ansible/roles/horizon/tasks/precheck.yml b/ansible/roles/horizon/tasks/precheck.yml deleted file mode 100644 index ed97d539c..000000000 --- a/ansible/roles/horizon/tasks/precheck.yml +++ /dev/null @@ -1 +0,0 @@ ---- diff --git a/ansible/roles/horizon/tasks/pull.yml b/ansible/roles/horizon/tasks/pull.yml deleted file mode 100644 index 99eab899d..000000000 --- a/ansible/roles/horizon/tasks/pull.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -- name: Pulling horizon image - kolla_docker: - action: "pull_image" - common_options: "{{ docker_common_options }}" - image: "{{ horizon_image_full }}" - when: inventory_hostname in groups['horizon'] diff --git a/ansible/roles/horizon/tasks/reconfigure.yml b/ansible/roles/horizon/tasks/reconfigure.yml deleted file mode 100644 index e4ae77c07..000000000 --- a/ansible/roles/horizon/tasks/reconfigure.yml +++ /dev/null @@ -1,64 +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: horizon, group: horizon } - -- 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: horizon, group: horizon } - -# NOTE(jeffrey4l): when config_strategy == 'COPY_ALWAYS' -# and container env['KOLLA_CONFIG_STRATEGY'] == 'COPY_ONCE', -# just remove the container and start again -- 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: horizon, group: horizon } - -- 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: horizon, group: horizon }] - - "{{ container_envs.results }}" - - "{{ check_results.results }}" - -- include: start.yml - when: remove_containers.changed - -- name: Restart containers - kolla_docker: - name: "{{ item[0]['name'] }}" - action: "restart_container" - when: - - config_strategy == 'COPY_ALWAYS' - - item[1]['KOLLA_CONFIG_STRATEGY'] != 'COPY_ONCE' - - item[2]['rc'] == 1 - - inventory_hostname in groups[item[0]['group']] - with_together: - - [{ name: horizon, group: horizon }] - - "{{ container_envs.results }}" - - "{{ check_results.results }}" diff --git a/ansible/roles/horizon/tasks/register.yml b/ansible/roles/horizon/tasks/register.yml deleted file mode 100644 index 0c78e9821..000000000 --- a/ansible/roles/horizon/tasks/register.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- -- name: Creating the _member_ role - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost - -m os_keystone_role - -a "name={{ horizon_openstack_keystone_default_role }} - auth={{ '{{ openstack_horizon_auth }}' }}" - -e "{'openstack_horizon_auth':{{ openstack_horizon_auth }}}" - register: horizon_role - changed_when: "{{ horizon_role.stdout.find('localhost | SUCCESS => ') != -1 and (horizon_role.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" - until: horizon_role.stdout.split()[2] == 'SUCCESS' - retries: 10 - delay: 5 - run_once: True diff --git a/ansible/roles/horizon/tasks/start.yml b/ansible/roles/horizon/tasks/start.yml deleted file mode 100644 index 746cae568..000000000 --- a/ansible/roles/horizon/tasks/start.yml +++ /dev/null @@ -1,14 +0,0 @@ ---- -- name: Starting horizon container - kolla_docker: - action: "start_container" - common_options: "{{ docker_common_options }}" - image: "{{ horizon_image_full }}" - name: "horizon" - environment: - ENABLE_NEUTRON_LBAAS: "{{ 'yes' if enable_neutron_lbaas | bool else 'no' }}" - volumes: - - "{{ node_config_directory }}/horizon/:{{ container_config_directory }}/:ro" - - "/etc/localtime:/etc/localtime:ro" - - "kolla_logs:/var/log/kolla/" - when: inventory_hostname in groups['horizon'] diff --git a/ansible/roles/horizon/tasks/upgrade.yml b/ansible/roles/horizon/tasks/upgrade.yml deleted file mode 100644 index 1f16915ad..000000000 --- a/ansible/roles/horizon/tasks/upgrade.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -- include: config.yml - -- include: start.yml |
