diff options
Diffstat (limited to 'ansible')
| -rw-r--r-- | ansible/group_vars/all.yml | 4 | ||||
| -rw-r--r-- | ansible/inventory/all-in-one | 3 | ||||
| -rw-r--r-- | ansible/inventory/multinode | 3 | ||||
| -rw-r--r-- | ansible/roles/etcd/defaults/main.yml | 10 | ||||
| -rw-r--r-- | ansible/roles/etcd/meta/main.yml | 3 | ||||
| -rw-r--r-- | ansible/roles/etcd/tasks/bootstrap.yml | 18 | ||||
| -rw-r--r-- | ansible/roles/etcd/tasks/config.yml | 15 | ||||
| -rw-r--r-- | ansible/roles/etcd/tasks/deploy.yml | 6 | ||||
| -rw-r--r-- | ansible/roles/etcd/tasks/main.yml | 2 | ||||
| -rw-r--r-- | ansible/roles/etcd/tasks/pull.yml | 6 | ||||
| -rw-r--r-- | ansible/roles/etcd/tasks/reconfigure.yml | 1 | ||||
| -rw-r--r-- | ansible/roles/etcd/tasks/start.yml | 24 | ||||
| -rw-r--r-- | ansible/roles/etcd/tasks/upgrade.yml | 4 | ||||
| -rw-r--r-- | ansible/roles/etcd/templates/etcd.json.j2 | 3 | ||||
| -rw-r--r-- | ansible/site.yml | 7 |
15 files changed, 109 insertions, 0 deletions
diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index 8dccd00e4..b0e5485fa 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -195,6 +195,9 @@ influxdb_http_port: "8086" senlin_api_port: "8778" +etcd_client_port: "2379" +etcd_peer_port: "2380" + public_protocol: "{{ 'https' if kolla_enable_tls_external | bool else 'http' }}" internal_protocol: "http" admin_protocol: "http" @@ -245,6 +248,7 @@ enable_cinder: "no" enable_cinder_backend_lvm: "no" enable_cloudkitty: "no" enable_congress: "no" +enable_etcd: "no" enable_gnocchi: "no" enable_grafana: "no" enable_heat: "yes" diff --git a/ansible/inventory/all-in-one b/ansible/inventory/all-in-one index d4c96d7da..a3be4315b 100644 --- a/ansible/inventory/all-in-one +++ b/ansible/inventory/all-in-one @@ -23,6 +23,9 @@ compute [grafana:children] monitoring +[etcd:children] +control + [kibana:children] control diff --git a/ansible/inventory/multinode b/ansible/inventory/multinode index f54341a15..542d8ecc3 100644 --- a/ansible/inventory/multinode +++ b/ansible/inventory/multinode @@ -41,6 +41,9 @@ compute [grafana:children] monitoring +[etcd:children] +control + [influxdb:children] monitoring diff --git a/ansible/roles/etcd/defaults/main.yml b/ansible/roles/etcd/defaults/main.yml new file mode 100644 index 000000000..c8f73263a --- /dev/null +++ b/ansible/roles/etcd/defaults/main.yml @@ -0,0 +1,10 @@ +--- +project_name: "etcd" + + +#################### +# Docker +#################### +etcd_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-etcd" +etcd_tag: "{{ openstack_release }}" +etcd_image_full: "{{ etcd_image }}:{{ etcd_tag }}" diff --git a/ansible/roles/etcd/meta/main.yml b/ansible/roles/etcd/meta/main.yml new file mode 100644 index 000000000..6b4fff8fe --- /dev/null +++ b/ansible/roles/etcd/meta/main.yml @@ -0,0 +1,3 @@ +--- +dependencies: + - { role: common } diff --git a/ansible/roles/etcd/tasks/bootstrap.yml b/ansible/roles/etcd/tasks/bootstrap.yml new file mode 100644 index 000000000..bea1cb7ec --- /dev/null +++ b/ansible/roles/etcd/tasks/bootstrap.yml @@ -0,0 +1,18 @@ +--- +- name: Running etcd bootstrap container + kolla_docker: + action: "start_container" + common_options: "{{ docker_common_options }}" + detach: False + environment: + KOLLA_BOOTSTRAP: + KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" + image: "{{ etcd_image_full }}" + labels: + BOOTSTRAP: + name: "bootstrap_etcd" + restart_policy: "never" + volumes: + - "{{ node_config_directory }}/etcd/:{{ container_config_directory }}/:ro" + - "kolla_etcd:/var/lib/etcd/" + - "kolla_logs:/var/log/kolla/" diff --git a/ansible/roles/etcd/tasks/config.yml b/ansible/roles/etcd/tasks/config.yml new file mode 100644 index 000000000..2ff3ac1f0 --- /dev/null +++ b/ansible/roles/etcd/tasks/config.yml @@ -0,0 +1,15 @@ +--- +- name: Ensuring config directories exist + file: + path: "{{ node_config_directory }}/{{ item }}" + state: "directory" + recurse: yes + with_items: + - "etcd" + +- name: Copying over config.json files for services + template: + src: "{{ item }}.json.j2" + dest: "{{ node_config_directory }}/{{ item }}/config.json" + with_items: + - "etcd" diff --git a/ansible/roles/etcd/tasks/deploy.yml b/ansible/roles/etcd/tasks/deploy.yml new file mode 100644 index 000000000..98daa4021 --- /dev/null +++ b/ansible/roles/etcd/tasks/deploy.yml @@ -0,0 +1,6 @@ +--- +- include: config.yml + +- include: bootstrap.yml + +- include: start.yml diff --git a/ansible/roles/etcd/tasks/main.yml b/ansible/roles/etcd/tasks/main.yml new file mode 100644 index 000000000..b017e8b4a --- /dev/null +++ b/ansible/roles/etcd/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include: "{{ action }}.yml" diff --git a/ansible/roles/etcd/tasks/pull.yml b/ansible/roles/etcd/tasks/pull.yml new file mode 100644 index 000000000..57d5bdae5 --- /dev/null +++ b/ansible/roles/etcd/tasks/pull.yml @@ -0,0 +1,6 @@ +--- +- name: Pulling etcd image + kolla_docker: + action: "pull_image" + common_options: "{{ docker_common_options }}" + image: "{{ etcd_image_full }}" diff --git a/ansible/roles/etcd/tasks/reconfigure.yml b/ansible/roles/etcd/tasks/reconfigure.yml new file mode 100644 index 000000000..ed97d539c --- /dev/null +++ b/ansible/roles/etcd/tasks/reconfigure.yml @@ -0,0 +1 @@ +--- diff --git a/ansible/roles/etcd/tasks/start.yml b/ansible/roles/etcd/tasks/start.yml new file mode 100644 index 000000000..7546f8841 --- /dev/null +++ b/ansible/roles/etcd/tasks/start.yml @@ -0,0 +1,24 @@ +--- +- name: Starting etcd container + kolla_docker: + action: "start_container" + common_options: "{{ docker_common_options }}" + environment: + ETCD_DATA_DIR: "/var/lib/etcd" + ETCD_NAME: "{{ ansible_hostname }}" + ETCD_ADVERTISE_CLIENT_URLS: "{{ internal_protocol }}://{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}:{{ etcd_client_port }}" + ETCD_LISTEN_CLIENT_URLS: "{{ internal_protocol }}://{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}:{{ etcd_client_port }}" + ETCD_INITIAL_ADVERTISE_PEER_URLS: "{{ internal_protocol }}://{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}:{{ etcd_peer_port }}" + ETCD_LISTEN_PEER_URLS: "{{ internal_protocol }}://{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}:{{ etcd_peer_port }}" + ETCD_INITIAL_CLUSTER_TOKEN: "{{ etcd_cluster_token }}" + ETCD_INITIAL_CLUSTER: "{% for host in groups['etcd'] %}{{ hostvars[host]['ansible_hostname'] }}={{ internal_protocol }}://{{ hostvars[host]['ansible_' + api_interface]['ipv4']['address'] }}:{{ etcd_peer_port }}{% if not loop.last %},{% endif %}{% endfor %}" + ETCD_INITIAL_CLUSTER_STATE: "new" + ETCD_OUT_FILE: "/var/log/kolla/etcd/etcd.log" + KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" + image: "{{ etcd_image_full }}" + name: "etcd" + volumes: + - "{{ node_config_directory }}/etcd/:{{ container_config_directory }}/:ro" + - "/etc/localtime:/etc/localtime:ro" + - "kolla_etcd:/var/lib/etcd/" + - "kolla_logs:/var/log/kolla/" diff --git a/ansible/roles/etcd/tasks/upgrade.yml b/ansible/roles/etcd/tasks/upgrade.yml new file mode 100644 index 000000000..1f16915ad --- /dev/null +++ b/ansible/roles/etcd/tasks/upgrade.yml @@ -0,0 +1,4 @@ +--- +- include: config.yml + +- include: start.yml diff --git a/ansible/roles/etcd/templates/etcd.json.j2 b/ansible/roles/etcd/templates/etcd.json.j2 new file mode 100644 index 000000000..3ea11fd90 --- /dev/null +++ b/ansible/roles/etcd/templates/etcd.json.j2 @@ -0,0 +1,3 @@ +{ + "command": "etcd" +} diff --git a/ansible/site.yml b/ansible/site.yml index 9134db55c..9aee3ca33 100644 --- a/ansible/site.yml +++ b/ansible/site.yml @@ -94,6 +94,13 @@ tags: rabbitmq, when: enable_rabbitmq | bool } +- hosts: etcd + serial: '{{ "30%" if action == "upgrade" else "0" }}' + roles: + - { role: etcd, + tags: etcd, + when: enable_etcd | bool } + - hosts: - keystone serial: '{{ "30%" if action == "upgrade" else "0" }}' |
