mirror of
https://github.com/ansible/awx.git
synced 2026-05-08 01:47:35 -02:30
yamllint: Make all files in awx pass yamllint
This commit updates all files that weren't passing yamllint for them to pass. A new yamllint target has been added. One can run `tox -e yamllint` or `yamllint -s .` locally to ensure yaml files are still passing. This check will be enabled in the CI so it can get on every new contributions, and prevent merging non-compliant code. Signed-off-by: Yanis Guenane <yguenane@redhat.com>
This commit is contained in:
@@ -55,7 +55,7 @@
|
||||
--port={{ pg_port | default('5432') }} \
|
||||
--username='{{ pg_username }}' \
|
||||
--dbname='{{ pg_database }}'" > {{ playbook_dir }}/tower-openshift-backup-{{ now }}/tower.db
|
||||
no_log: yes
|
||||
no_log: true
|
||||
|
||||
- name: Copy inventory into backup directory
|
||||
copy:
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
- name: Get Namespace Detail
|
||||
shell: "kubectl get namespace {{ kubernetes_namespace }}"
|
||||
register: namespace_details
|
||||
ignore_errors: yes
|
||||
ignore_errors: true
|
||||
|
||||
- name: Create AWX Kubernetes Project
|
||||
shell: "kubectl create namespace {{ kubernetes_namespace }}"
|
||||
@@ -12,4 +12,3 @@
|
||||
set_fact:
|
||||
postgresql_service_name: "{{ kubernetes_deployment_name }}-postgresql"
|
||||
when: "pg_hostname is not defined or pg_hostname == ''"
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
{{ kubernetes_deployment_name }} \
|
||||
-n {{ kubernetes_namespace }} -o=jsonpath='{.status.replicas}'
|
||||
register: deployment_details
|
||||
ignore_errors: yes
|
||||
ignore_errors: true
|
||||
|
||||
- name: Set expected post-deployment Replicas value
|
||||
set_fact:
|
||||
@@ -48,7 +48,7 @@
|
||||
- name: Get Postgres Service Detail
|
||||
shell: "{{ kubectl_or_oc }} describe svc {{ postgresql_service_name }} -n {{ kubernetes_namespace }}"
|
||||
register: postgres_svc_details
|
||||
ignore_errors: yes
|
||||
ignore_errors: true
|
||||
when: "pg_hostname is not defined or pg_hostname == ''"
|
||||
|
||||
- name: Deploy PostgreSQL (OpenShift)
|
||||
@@ -72,7 +72,7 @@
|
||||
-e POSTGRESQL_VERSION=10 \
|
||||
-n {{ kubernetes_namespace }}
|
||||
register: openshift_pg_activate
|
||||
no_log: yes
|
||||
no_log: true
|
||||
when:
|
||||
- pg_hostname is not defined or pg_hostname == ''
|
||||
- postgres_svc_details is defined and postgres_svc_details.rc != 0
|
||||
@@ -83,7 +83,7 @@
|
||||
- name: Template PostgreSQL Deployment (Kubernetes)
|
||||
set_fact:
|
||||
pg_values: "{{ lookup('template', 'postgresql-values.yml.j2') }}"
|
||||
no_log: yes
|
||||
no_log: true
|
||||
|
||||
- name: Deploy and Activate Postgres (Kubernetes)
|
||||
shell: |
|
||||
@@ -95,7 +95,7 @@
|
||||
--values - \
|
||||
stable/postgresql
|
||||
register: kubernetes_pg_activate
|
||||
no_log: yes
|
||||
no_log: true
|
||||
when:
|
||||
- pg_hostname is not defined or pg_hostname == ''
|
||||
- postgres_svc_details is defined and postgres_svc_details.rc != 0
|
||||
@@ -206,7 +206,7 @@
|
||||
- 'configmap'
|
||||
- 'deployment'
|
||||
- 'secret'
|
||||
no_log: yes
|
||||
no_log: true
|
||||
|
||||
- name: Apply Deployment
|
||||
shell: |
|
||||
@@ -215,7 +215,7 @@
|
||||
- "{{ configmap }}"
|
||||
- "{{ deployment }}"
|
||||
- "{{ secret }}"
|
||||
no_log: yes
|
||||
no_log: true
|
||||
|
||||
- name: Delete any existing management pod
|
||||
shell: |
|
||||
@@ -249,21 +249,21 @@
|
||||
{{ kubectl_or_oc }} -n {{ kubernetes_namespace }} exec ansible-tower-management -- \
|
||||
bash -c "echo 'from django.contrib.auth.models import User; nsu = User.objects.filter(is_superuser=True).count(); exit(0 if nsu > 0 else 1)' | awx-manage shell"
|
||||
register: super_check
|
||||
ignore_errors: yes
|
||||
ignore_errors: true
|
||||
changed_when: super_check.rc > 0
|
||||
|
||||
- name: create django super user if it does not exist
|
||||
shell: |
|
||||
{{ kubectl_or_oc }} -n {{ kubernetes_namespace }} exec ansible-tower-management -- \
|
||||
bash -c "echo \"from django.contrib.auth.models import User; User.objects.create_superuser('{{ admin_user }}', '{{ admin_email }}', '{{ admin_password }}')\" | awx-manage shell"
|
||||
no_log: yes
|
||||
no_log: true
|
||||
when: super_check.rc > 0
|
||||
|
||||
- name: update django super user password
|
||||
shell: |
|
||||
{{ kubectl_or_oc }} -n {{ kubernetes_namespace }} exec ansible-tower-management -- \
|
||||
bash -c "awx-manage update_password --username='{{ admin_user }}' --password='{{ admin_password }}'"
|
||||
no_log: yes
|
||||
no_log: true
|
||||
register: result
|
||||
changed_when: "'Password updated' in result.stdout"
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
- name: Get Project Detail
|
||||
shell: "{{ openshift_oc_bin }} get project {{ openshift_project }}"
|
||||
register: project_details
|
||||
ignore_errors: yes
|
||||
ignore_errors: true
|
||||
|
||||
- name: Create AWX Openshift Project
|
||||
shell: "{{ openshift_oc_bin }} new-project {{ openshift_project }}"
|
||||
@@ -13,7 +13,7 @@
|
||||
- name: Check PVC status
|
||||
command: "{{ openshift_oc_bin }} get pvc {{ openshift_pg_pvc_name }} -n {{ openshift_project }} -o=jsonpath='{.status.phase}'"
|
||||
register: pg_pvc_status
|
||||
ignore_errors: yes
|
||||
ignore_errors: true
|
||||
|
||||
- name: Ensure PostgreSQL PVC is available
|
||||
assert:
|
||||
|
||||
@@ -54,4 +54,3 @@
|
||||
fail:
|
||||
msg: "{{ openshift_auth_result.stderr | default('Invalid token') }}"
|
||||
when: openshift_auth_result.rc is defined and openshift_auth_result.rc != 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user