mirror of
https://gitea.com/mcereda/oam.git
synced 2026-02-09 05:44:23 +00:00
fix(pulumi/examples): use handlers
This commit is contained in:
@@ -1,6 +1,4 @@
|
|||||||
ansible/playbooks/aws.ec2.enable-ssm-agent.yml package-latest
|
ansible/playbooks/aws.ec2.enable-ssm-agent.yml package-latest
|
||||||
ansible/playbooks/keybase.register-device.yml no-changed-when
|
ansible/playbooks/keybase.register-device.yml no-changed-when
|
||||||
examples/ansible/aws_ec2.yml yaml[comments-indentation]
|
examples/ansible/aws_ec2.yml yaml[comments-indentation]
|
||||||
examples/pulumi/gitlab-omnibus-on-aws-ec2/ansible-playbook.yml package-latest
|
examples/pulumi/gitlab-omnibus-on-aws-ec2/ansible-playbook.yml package-latest
|
||||||
examples/pulumi/gitlab-omnibus-on-aws-ec2/ansible-role-gitlab-omnibus-on-ec2/tasks/configure/omnibus.yml no-handler
|
|
||||||
examples/pulumi/gitlab-omnibus-on-aws-ec2/ansible-role-gitlab-omnibus-on-ec2/tasks/pre-flight.yml name[template]
|
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
- name: "Validate Gitlab's configuration file"
|
||||||
|
become: true
|
||||||
|
ansible.builtin.command: >-
|
||||||
|
gitlab-ctl show-config
|
||||||
|
register: config_file_validation
|
||||||
|
changed_when: false
|
||||||
|
failed_when: config_file_validation.rc != 0
|
||||||
|
|
||||||
|
- name: Reconfigure Gitlab
|
||||||
|
when: config_file_validation is not failed
|
||||||
|
become: true
|
||||||
|
ansible.builtin.command: >-
|
||||||
|
gitlab-ctl reconfigure
|
||||||
|
register: reconfiguration
|
||||||
|
changed_when:
|
||||||
|
- reconfiguration.rc == 0
|
||||||
|
- >-
|
||||||
|
(
|
||||||
|
reconfiguration.stdout
|
||||||
|
| regex_findall('Infra Phase complete, .*')
|
||||||
|
) is not search('0/')
|
||||||
|
failed_when: reconfiguration.rc != 0
|
||||||
@@ -10,32 +10,6 @@
|
|||||||
mode: u=rw,g=,o=
|
mode: u=rw,g=,o=
|
||||||
backup: true
|
backup: true
|
||||||
register: config_file
|
register: config_file
|
||||||
|
notify:
|
||||||
- name: Validate the configuration file
|
- "Validate Gitlab's configuration file"
|
||||||
# Since it cannot be validated by the 'template' module as it requires a file name to be specified.
|
- Reconfigure Gitlab
|
||||||
when: config_file is changed
|
|
||||||
become: true
|
|
||||||
ansible.builtin.command: >-
|
|
||||||
gitlab-ctl show-config
|
|
||||||
register: config_file_validation
|
|
||||||
changed_when: false
|
|
||||||
failed_when: config_file_validation.rc != 0
|
|
||||||
|
|
||||||
- name: Reconfigure Gitlab
|
|
||||||
when:
|
|
||||||
- config_file is changed
|
|
||||||
- config_file_validation is not failed
|
|
||||||
become: true
|
|
||||||
ansible.builtin.command: >-
|
|
||||||
gitlab-ctl reconfigure
|
|
||||||
register: reconfiguration
|
|
||||||
changed_when:
|
|
||||||
- reconfiguration.rc == 0
|
|
||||||
- >-
|
|
||||||
{{
|
|
||||||
(
|
|
||||||
reconfiguration.stdout
|
|
||||||
| regex_findall('Infra Phase complete, .*')
|
|
||||||
) is not search('0/')
|
|
||||||
}}
|
|
||||||
failed_when: reconfiguration.rc != 0
|
|
||||||
|
|||||||
@@ -58,7 +58,7 @@
|
|||||||
register: initial_password_file_stat
|
register: initial_password_file_stat
|
||||||
- name: Recover the auto-generated administrator's initial password
|
- name: Recover the auto-generated administrator's initial password
|
||||||
block:
|
block:
|
||||||
- name: Read the initial password file
|
- name: Recover the password from the initial password file
|
||||||
when: initial_password_file_stat.stat.exists
|
when: initial_password_file_stat.stat.exists
|
||||||
block:
|
block:
|
||||||
- name: Read the initial password file
|
- name: Read the initial password file
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
- never
|
- never
|
||||||
ansible.builtin.debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ query('community.dns.lookup', external_url_hostname) }}"
|
msg: "{{ query('community.dns.lookup', external_url_hostname) }}"
|
||||||
- name: Check an A or AAAA DNS record for '{{ external_url_hostname }}' exist
|
- name: Check an A or AAAA DNS record already exists for '{{ external_url_hostname }}'
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: >-
|
that: >-
|
||||||
query('community.dns.lookup', external_url_hostname) != [] or
|
query('community.dns.lookup', external_url_hostname) != [] or
|
||||||
|
|||||||
Reference in New Issue
Block a user