add Final Infrastructure Setup
This commit is contained in:
commit
7733dde658
174 changed files with 204949 additions and 0 deletions
74
infrastructure/ansible/roles/mft-create-nodes/tasks/main.yml
Normal file
74
infrastructure/ansible/roles/mft-create-nodes/tasks/main.yml
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
---
|
||||
|
||||
- name: Get node list, retry on error
|
||||
uri:
|
||||
url: https://{{ ansible_fqdn }}:{{ configs.mft_services.transfer_job_manager.proxy_port }}/transfer-job-manager/v1/admin/nodes
|
||||
status_code: 200
|
||||
user: "{{ configs.mft_services.transfer_job_manager.api_user }}"
|
||||
password: "{{ configs.mft_services.transfer_job_manager.api_pass }}"
|
||||
force_basic_auth: yes
|
||||
client_cert: "{{ cert_cert_path.remote }}"
|
||||
client_key: "{{ cert_key_path.remote }}"
|
||||
validate_certs: false
|
||||
register: nodes_response
|
||||
until: nodes_response.status == 200
|
||||
retries: 20
|
||||
delay: 5
|
||||
become: true
|
||||
|
||||
- name: Create nodes on a host operating as MFT normally
|
||||
uri:
|
||||
url: https://{{ ansible_fqdn }}:{{ configs.mft_services.transfer_job_manager.proxy_port }}/transfer-job-manager/v1/admin/nodes
|
||||
method: POST
|
||||
status_code: 201
|
||||
user: "{{ configs.mft_services.transfer_job_manager.api_user }}"
|
||||
password: "{{ configs.mft_services.transfer_job_manager.api_pass }}"
|
||||
force_basic_auth: yes
|
||||
client_cert: "{{ cert_cert_path.remote }}"
|
||||
client_key: "{{ cert_key_path.remote }}"
|
||||
validate_certs: false
|
||||
body:
|
||||
name: "{{ item.value.name }}"
|
||||
address: "https://{{ item.value.hostname }}:{{ configs.mft_services.transfer_job_manager.proxy_port }}/transfer-job-manager/v1"
|
||||
encryption_policy: "{{item.value.encryption_policy}}"
|
||||
checksum_policy: "{{item.value.checksum_policy}}"
|
||||
body_format: json
|
||||
vars:
|
||||
existing: "{{ nodes_response|json_query('json[*].name') }}"
|
||||
when:
|
||||
- item.value.name not in existing
|
||||
- item.value.contains_setup is defined
|
||||
- "'mft' in item.value.contains_setup"
|
||||
with_dict: "{{ configs.host_config }}"
|
||||
become: true
|
||||
|
||||
- name: Create nodes on a host operating as a clustered MFT
|
||||
uri:
|
||||
url: https://{{ ansible_fqdn }}:{{ configs.mft_services.transfer_job_manager.proxy_port }}/transfer-job-manager/v1/admin/nodes
|
||||
method: POST
|
||||
status_code: 201
|
||||
user: "{{ configs.mft_services.transfer_job_manager.api_user }}"
|
||||
password: "{{ configs.mft_services.transfer_job_manager.api_pass }}"
|
||||
force_basic_auth: yes
|
||||
client_cert: "{{ cert_cert_path.remote }}"
|
||||
client_key: "{{ cert_key_path.remote }}"
|
||||
validate_certs: false
|
||||
body:
|
||||
name: "{{ item.value.name }}"
|
||||
address: "https://{{ item.value.cluster_hostname }}:{{ configs.mft_services.transfer_job_manager.proxy_port }}/transfer-job-manager/v1"
|
||||
encryption_policy: "{{item.value.encryption_policy}}"
|
||||
checksum_policy: "{{item.value.checksum_policy}}"
|
||||
body_format: json
|
||||
|
||||
vars:
|
||||
existing: "{{ nodes_response|json_query('json[*].name') }}"
|
||||
when:
|
||||
- item.value.name not in existing
|
||||
- "'spain' not in existing"
|
||||
- item.value.contains_setup is defined
|
||||
- "'mft-cluster-node' in item.value.contains_setup"
|
||||
- item.value.hostname != 'valencia.tixeltec.de'
|
||||
with_dict: "{{ configs.host_config }}"
|
||||
become: true
|
||||
|
||||
# vim:ft=ansible
|
||||
Loading…
Add table
Add a link
Reference in a new issue