Skip to content
Snippets Groups Projects
Commit 8b20f9d3 authored by Antoine SCHILDKNECHT's avatar Antoine SCHILDKNECHT
Browse files

Merge branch 't36656-certbot-hook' into 'main'

Remove useless nginx test in post-hook | refs #36656

See merge request sys/ansible-public!27
parents 110c87ff fbe17dcb
No related branches found
No related tags found
No related merge requests found
Showing
with 20 additions and 88 deletions
--- ---
skyreach_system_key: changeme skyreach_system_key: changeme
...
--- ---
# customer name # customer name
customer_short_name: customer customer_short_name: customer
...@@ -12,5 +11,3 @@ conf_update: false ...@@ -12,5 +11,3 @@ conf_update: false
# activation keys # activation keys
skyreach_system_key: skyreach_system_key:
skyreach_activation_key: skyreach_activation_key:
...
--- ---
# activation keys # activation keys
skyreach_system_key: skyreach_system_key:
skyreach_activation_key: skyreach_activation_key:
...
--- ---
# customer name # customer name
customer_short_name: customer customer_short_name: customer
...@@ -12,5 +11,3 @@ conf_update: false ...@@ -12,5 +11,3 @@ conf_update: false
# activation keys # activation keys
skyreach_system_key: skyreach_system_key:
skyreach_activation_key: skyreach_activation_key:
...
--- ---
skyreach_system_key: skyreach_system_key:
skyreach_activation_key: skyreach_activation_key:
...
--- ---
skyreach_system_key: skyreach_system_key:
skyreach_activation_key: skyreach_activation_key:
...
--- ---
# customer name # customer name
customer_short_name: customer customer_short_name: customer
# install in offline environment # install in offline environment
offline_mode: true offline_mode: true
...
--- ---
# install in offline environment # install in offline environment
offline_mode: true offline_mode: true
...
...@@ -2,4 +2,3 @@ ...@@ -2,4 +2,3 @@
# activation keys # activation keys
skyreach_system_key: skyreach_system_key:
skyreach_activation_key: skyreach_activation_key:
...
#!/usr/bin/env ansible-playbook #!/usr/bin/env ansible-playbook
--- ---
- name: BASE - name: BASE
hosts: all hosts: all
tags: all tags: all
roles: roles:
- base - base
...
#!/usr/bin/env ansible-playbook #!/usr/bin/env ansible-playbook
--- ---
- name: DEPLOY ELASTIC KIBANA SERVER - name: DEPLOY ELASTIC KIBANA SERVER
hosts: elastic hosts: elastic
tags: ['never', 'monbench'] tags: [never, monbench]
vars: vars:
- es_heap_size: 2g - es_heap_size: 2g
- es_config: - es_config:
...@@ -20,12 +19,10 @@ ...@@ -20,12 +19,10 @@
- name: DEPLOY METRICBEAT WORKERS - name: DEPLOY METRICBEAT WORKERS
hosts: mediaserver,postgres hosts: mediaserver,postgres
tags: ['never', 'monbench'] tags: [never, monbench]
vars: vars:
- kibana_server_host: "{{ hostvars[groups['elastic'][0]]['ansible_default_ipv4']['address'] }}" - kibana_server_host: "{{ hostvars[groups['elastic'][0]]['ansible_default_ipv4']['address'] }}"
- elastic_host: "{{ es_config['network.host'] }}" - elastic_host: "{{ es_config['network.host'] }}"
- es_api_host: "{{ es_config['network.host'] }}" - es_api_host: "{{ es_config['network.host'] }}"
roles: roles:
- metricbeat - metricbeat
...
#!/usr/bin/env ansible-playbook #!/usr/bin/env ansible-playbook
--- ---
- name: DEPLOY BENCHMARK SERVER - name: DEPLOY BENCHMARK SERVER
hosts: bench_server hosts: bench_server
pre_tasks: pre_tasks:
- name: "Fail is benchmark server is not unique" - name: Fail is benchmark server is not unique
ansible.builtin.fail: ansible.builtin.fail:
msg: "Benchmark server must be unique" msg: Benchmark server must be unique
when: groups['bench_server'] | length > 1 when: groups['bench_server'] | length > 1
tags: bench_server tags: bench_server
roles: roles:
...@@ -33,5 +32,3 @@ ...@@ -33,5 +32,3 @@
ansible.builtin.service: ansible.builtin.service:
name: bench-worker name: bench-worker
state: restarted state: restarted
...
#!/usr/bin/env ansible-playbook #!/usr/bin/env ansible-playbook
--- ---
- name: CELERITY SERVER - name: CELERITY SERVER
hosts: celerity hosts: celerity
tags: celerity tags: celerity
...@@ -15,5 +14,3 @@ ...@@ -15,5 +14,3 @@
when: proxy_apply | d(false) when: proxy_apply | d(false)
ansible.builtin.include_role: ansible.builtin.include_role:
name: proxy name: proxy
...
#!/usr/bin/env ansible-playbook #!/usr/bin/env ansible-playbook
--- ---
- name: Let's encrypt - name: Let's encrypt
hosts: all hosts: all
tags: all tags: all
roles: roles:
- letsencrypt - letsencrypt
...
--- ---
- name: LIVE - name: LIVE
hosts: live hosts: live
gather_facts: false gather_facts: false
...@@ -8,17 +7,7 @@ ...@@ -8,17 +7,7 @@
- live - live
- import_playbook: subplays/standard-case.yml - import_playbook: subplays/standard-case.yml
when: groups['live'] | d('') | length >= 1 when: groups['live'] | d('') | length >= 1 and ( hostvars[groups['live'][0]].ip_live is undefined or hostvars[groups['live'][0]].ip_live == "127.0.0.1" )
and (
hostvars[groups['live'][0]].ip_live is undefined
or hostvars[groups['live'][0]].ip_live == "127.0.0.1"
)
- import_playbook: subplays/ha-case.yml - import_playbook: subplays/ha-case.yml
when: groups['live'] | d('') | length >= 1 when: groups['live'] | d('') | length >= 1 and ( hostvars[groups['live'][0]].ip_live is defined and hostvars[groups['live'][0]].ip_live != "127.0.0.1" )
and (
hostvars[groups['live'][0]].ip_live is defined
and hostvars[groups['live'][0]].ip_live != "127.0.0.1"
)
...
--- ---
- name: LIVE - name: LIVE
hosts: live hosts: live
tags: live tags: live
...@@ -35,5 +34,3 @@ ...@@ -35,5 +34,3 @@
- import_playbook: deploy-minimal.yml - import_playbook: deploy-minimal.yml
tags: live tags: live
...
--- ---
- name: Checking the live(s) server(s) live configuration state - name: Checking the live(s) server(s) live configuration state
hosts: live hosts: live
gather_facts: false gather_facts: false
...@@ -66,8 +65,7 @@ ...@@ -66,8 +65,7 @@
- name: Comparing the app secrets from MS an live servers with the reference - name: Comparing the app secrets from MS an live servers with the reference
ansible.builtin.set_fact: ansible.builtin.set_fact:
app_secret_diff: true app_secret_diff: true
when: base_live_secret is defined when: base_live_secret is defined and hostvars[item].live_secret != base_live_secret
and hostvars[item].live_secret != base_live_secret
with_items: with_items:
- "{{ groups['live'] }}" - "{{ groups['live'] }}"
- "{{ groups['mediaserver'] }}" - "{{ groups['mediaserver'] }}"
...@@ -79,9 +77,8 @@ ...@@ -79,9 +77,8 @@
register: secret register: secret
args: args:
executable: /bin/bash executable: /bin/bash
failed_when: false # Ansible-lint requires pipefail, but the return is then non-null so we have to force this failed_when: false # Ansible-lint requires pipefail, but the return is then non-null so we have to force this
when: base_live_secret is not defined when: base_live_secret is not defined or app_secret_diff
or app_secret_diff
- name: Deciding the application secret to use - name: Deciding the application secret to use
ansible.builtin.set_fact: ansible.builtin.set_fact:
...@@ -110,7 +107,7 @@ ...@@ -110,7 +107,7 @@
owner: nginx owner: nginx
group: root group: root
state: directory state: directory
mode: '0700' mode: "0700"
- name: Create the nginx RTMP web directory symlink - name: Create the nginx RTMP web directory symlink
notify: Reload nginx notify: Reload nginx
...@@ -167,7 +164,7 @@ ...@@ -167,7 +164,7 @@
- name: Set the RTMP_PLAYBACK_URL in lives configuration - name: Set the RTMP_PLAYBACK_URL in lives configuration
vars: vars:
rtmp_playback_line: rtmp_playback_line:
RTMP_PLAYBACK_URL: null RTMP_PLAYBACK_URL:
ansible.builtin.set_fact: ansible.builtin.set_fact:
lives_config: "{{ lives_config | combine(rtmp_playback_line) }}" lives_config: "{{ lives_config | combine(rtmp_playback_line) }}"
...@@ -182,15 +179,13 @@ ...@@ -182,15 +179,13 @@
notify: Restart mediaserver notify: Restart mediaserver
ansible.builtin.copy: ansible.builtin.copy:
content: "{{ lives_config | to_nice_json }}" content: "{{ lives_config | to_nice_json }}"
dest: "/home/{{ live_app_name }}/msinstance/conf/lives.json" dest: /home/{{ live_app_name }}/msinstance/conf/lives.json
owner: "{{ live_app_name }}" owner: "{{ live_app_name }}"
group: "{{ live_app_name }}" group: "{{ live_app_name }}"
mode: '0600' mode: "0600"
handlers: handlers:
- name: Restart mediaserver - name: Restart mediaserver
ansible.builtin.systemd: ansible.builtin.systemd:
name: mediaserver name: mediaserver
state: restarted state: restarted
...
--- ---
- name: Live vhost setup - name: Live vhost setup
hosts: live hosts: live
tags: live tags: live
...@@ -8,15 +7,15 @@ ...@@ -8,15 +7,15 @@
- name: resolve domain name to localhost - name: resolve domain name to localhost
ansible.builtin.lineinfile: ansible.builtin.lineinfile:
path: /etc/hosts path: /etc/hosts
line: '127.0.1.1 {{ live_domain }}' line: 127.0.1.1 {{ live_domain }}
backup: true backup: true
- name: fill the vhost file - name: fill the vhost file
notify: Restart nginx notify: Restart nginx
ansible.builtin.replace: ansible.builtin.replace:
path: /etc/nginx/sites-available/live-rtmp.conf path: /etc/nginx/sites-available/live-rtmp.conf
regexp: '^(\s+server_name)\s+.*(;)$' regexp: ^(\s+server_name)\s+.*(;)$
replace: '\1 {{ live_domain }}\2' replace: \1 {{ live_domain }}\2
- name: Activating the live vhost configuration - name: Activating the live vhost configuration
notify: Restart nginx notify: Restart nginx
...@@ -34,8 +33,8 @@ ...@@ -34,8 +33,8 @@
- import_playbook: ../functions/create-live-app.yml - import_playbook: ../functions/create-live-app.yml
vars: vars:
live_app_name: msuser live_app_name: msuser
rtmp_hls_url: "https://{{ hostvars[groups['live'][0]].live_domain }}/streaming-rtmp/%(rtmp_name)s/%(stream_id)s.m3u8" rtmp_hls_url: https://{{ hostvars[groups['live'][0]].live_domain }}/streaming-rtmp/%(rtmp_name)s/%(stream_id)s.m3u8
rtmp_pub_url: "rtmp://{{ hostvars[groups['live'][0]].live_domain }}/%(rtmp_app)s/%(stream_id)s" rtmp_pub_url: rtmp://{{ hostvars[groups['live'][0]].live_domain }}/%(rtmp_app)s/%(stream_id)s
deploy_case: ha deploy_case: ha
- hosts: mediaserver - hosts: mediaserver
...@@ -52,5 +51,3 @@ ...@@ -52,5 +51,3 @@
args: args:
warn: false warn: false
when: rtmp_conf_dir.stat.exists when: rtmp_conf_dir.stat.exists
...
--- ---
- import_playbook: ../functions/create-live-app.yml - import_playbook: ../functions/create-live-app.yml
vars: vars:
live_app_name: msuser live_app_name: msuser
rtmp_hls_url: "https://%(ms_host)s/streaming-rtmp/%(stream_id)s.m3u8" rtmp_hls_url: https://%(ms_host)s/streaming-rtmp/%(stream_id)s.m3u8
rtmp_pub_url: "rtmp://%(ms_host)s/%(rtmp_app)s/%(stream_id)s" rtmp_pub_url: rtmp://%(ms_host)s/%(rtmp_app)s/%(stream_id)s
deploy_case: standard deploy_case: standard
...
#!/usr/bin/env ansible-playbook #!/usr/bin/env ansible-playbook
--- ---
- name: MEDIACACHE - name: MEDIACACHE
hosts: mediacache hosts: mediacache
tags: mediacache tags: mediacache
...@@ -19,5 +18,3 @@ ...@@ -19,5 +18,3 @@
when: proxy_apply | d(false) when: proxy_apply | d(false)
ansible.builtin.include_role: ansible.builtin.include_role:
name: proxy name: proxy
...
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment