Skip to content

Commit

Permalink
Merge pull request #151 from m-a-leclercq/patch-1
Browse files Browse the repository at this point in the history
Fix conditionals for compatibility with ansible 2.9
  • Loading branch information
obierlaire authored May 4, 2022
2 parents 13d8e4e + b382832 commit 71e3f4f
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions tasks/ece-bootstrap/secondary/install_stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
ece_roles: [director, coordinator, proxy, allocator]
when: ece_roles is undefined

- name: Set empty capacity if not defined
set_fact:
capacity: "{{ capacity | default('') }}"

- name: Get the roles token
uri:
url: "https://{{primary_hostname}}:12443/api/v1/platform/configuration/security/enrollment-tokens"
Expand All @@ -24,7 +20,18 @@
register: roles_token

- name: Execute installation
shell: /home/elastic/elastic-cloud-enterprise.sh --coordinator-host {{ primary_hostname }} --roles-token '{{ roles_token.json.token }}' --roles '{{ ece_roles | join(',') }}' --availability-zone {{ availability_zone }} --cloud-enterprise-version {{ ece_version }} --docker-registry {{ ece_docker_registry }} --ece-docker-repository {{ ece_docker_repository }} --host-storage-path {{ data_dir }}/elastic --memory-settings '{{ memory_settings }}' --runner-id {{ ece_runner_id }} {{ '--capacity ' + capacity if capacity }}
shell: /home/elastic/elastic-cloud-enterprise.sh
--coordinator-host {{ primary_hostname }}
--roles-token '{{ roles_token.json.token }}'
--roles '{{ ece_roles | join(',') }}'
--availability-zone {{ availability_zone }}
--cloud-enterprise-version {{ ece_version }}
--docker-registry {{ ece_docker_registry }}
--ece-docker-repository {{ ece_docker_repository }}
--host-storage-path {{ data_dir }}/elastic
--memory-settings '{{ memory_settings }}'
--runner-id {{ ece_runner_id }}{% if capacity is defined %}
--capacity {{ capacity }}{% endif %}
become: yes
become_method: sudo
become_user: elastic
Expand Down

0 comments on commit 71e3f4f

Please sign in to comment.