|
50 | 50 | - name: Copy specified client config file to remote machine
|
51 | 51 | copy: src={{ item.src }} dest={{ item.dest }}
|
52 | 52 | with_items:
|
53 |
| - - { src: "{{client_config}}", dest: "{{ client.PERSISTENT_PATH }}/config.yml" } |
| 53 | + - { src: "{{client_config}}", dest: "{{ client.PERSISTENT_PATH }}/config.yml" } |
54 | 54 | when: client_config is defined
|
55 | 55 | tags: always
|
56 | 56 |
|
|
64 | 64 | - name: Copy specified server pem file to remote machine persistent from default path
|
65 | 65 | copy: src={{ item.src }} dest={{ item.dest }}
|
66 | 66 | with_items:
|
67 |
| - - { src: "{{client.CERT_FILE_PATH}}", dest: "{{ client.PERSISTENT_PATH }}/server.pem" } |
| 67 | + - { src: "{{client.CERT_FILE_PATH}}", dest: "{{ client.PERSISTENT_PATH }}/server.pem" } |
68 | 68 | when: client_server_pem is not defined and stat_client_pem.stat.exists == False
|
69 | 69 | tags: always
|
70 | 70 |
|
|
78 | 78 | - name: Copy specified ca pem file to remote machine persistent from default path
|
79 | 79 | copy: src={{ item.src }} dest={{ item.dest }}
|
80 | 80 | with_items:
|
81 |
| - - { src: "{{client.CA_FILE_PATH}}", dest: "{{ client.PERSISTENT_PATH }}/CA.pem" } |
| 81 | + - { src: "{{client.CA_FILE_PATH}}", dest: "{{ client.PERSISTENT_PATH }}/CA.pem" } |
82 | 82 | when: client_ca_pem is not defined and stat_ca_pem.stat.exists == False
|
83 | 83 | tags: always
|
84 | 84 |
|
|
114 | 114 | shell: rm -f "{{ client.REPO_PATH }}"/.ansible_environment && jq -r '.[]|"\(.key)=\(.value)"' "{{ client.REPO_PATH }}"/.ansible_environment_*.json >> "{{ client.REPO_PATH }}"/.ansible_environment
|
115 | 115 | tags: always
|
116 | 116 |
|
117 |
| - - name: Append variables to env file |
118 |
| - shell: cat "{{ client.REPO_PATH }}"/.ansible_environment >> "{{ client.REPO_PATH }}"/.env |
119 |
| - tags: always |
120 | 117 |
|
| 118 | + - name: Read existing content from .ansible_environment |
| 119 | + slurp: |
| 120 | + src: "{{ client.REPO_PATH }}/.ansible_environment" |
| 121 | + register: existing_content |
| 122 | + |
| 123 | + - name: Append variables with empty line to .env |
| 124 | + lineinfile: |
| 125 | + path: "{{ client.REPO_PATH }}/.env" |
| 126 | + insertafter: EOF |
| 127 | + line: "" |
| 128 | + state: present |
| 129 | + create: yes |
| 130 | + - name: Append existing content to .env |
| 131 | + lineinfile: |
| 132 | + path: "{{ client.REPO_PATH }}/.env" |
| 133 | + insertafter: "" |
| 134 | + line: "{{ existing_content.content | b64decode | string }}" |
| 135 | + tags: always |
121 | 136 | # Start
|
122 | 137 | - name: Start client docker container without bibigrid
|
123 | 138 | docker_compose:
|
|
131 | 146 |
|
132 | 147 | - name: Start docker container with bibigrid
|
133 | 148 | docker_compose:
|
134 |
| - recreate: always |
135 |
| - pull: yes |
136 |
| - project_src: "{{ client.REPO_PATH }}" |
137 |
| - files: |
138 |
| - - docker-compose.bibigrid.yml |
| 149 | + recreate: always |
| 150 | + pull: yes |
| 151 | + project_src: "{{ client.REPO_PATH }}" |
| 152 | + files: |
| 153 | + - docker-compose.bibigrid.yml |
139 | 154 | become: yes
|
140 |
| - tags: ['never', 'bibigrid'] |
| 155 | + tags: [ 'never', 'bibigrid' ] |
0 commit comments