From f793aa66d9ba9e9ec1cabc41ad19ca11b3664704 Mon Sep 17 00:00:00 2001 From: Louis Abel Date: Mon, 9 Oct 2023 10:59:30 -0700 Subject: [PATCH] start to add compose calls --- adhoc-compose-run-sig.yml | 22 ++++++++++++++++++++++ adhoc-compose-run.yml | 22 ++++++++++++++++++++++ adhoc-compose-sync-generate-filelist.yml | 1 - adhoc-compose-sync-production.yml | 1 - adhoc-compose-sync-staging.yml | 1 - tasks/sync/sync_to_prod.yml | 9 --------- tasks/sync/sync_to_staging.yml | 2 +- 7 files changed, 45 insertions(+), 13 deletions(-) create mode 100644 adhoc-compose-run-sig.yml create mode 100644 adhoc-compose-run.yml diff --git a/adhoc-compose-run-sig.yml b/adhoc-compose-run-sig.yml new file mode 100644 index 0000000..7d1c67c --- /dev/null +++ b/adhoc-compose-run-sig.yml @@ -0,0 +1,22 @@ +--- +# This playbook is meant to be used with callable variables, like adhoc or AWX. +- name: Run a compose + hosts: srpmproc + become: true + become_user: root + vars_files: + - "vars/common.yml" + + pre_tasks: + - name: "Verify vars are set" + ansible.builtin.assert: + that: + - release_ver|int >= 8 + - sig + success_msg: "We are ready to compose" + fail_msg: "release_ver or sig is not set correctly." + + tasks: + - name: "Run compose operation" + import_tasks: tasks/compose-sig.yml +... diff --git a/adhoc-compose-run.yml b/adhoc-compose-run.yml new file mode 100644 index 0000000..73a3ee7 --- /dev/null +++ b/adhoc-compose-run.yml @@ -0,0 +1,22 @@ +--- +# This playbook is meant to be used with callable variables, like adhoc or AWX. +- name: Run a compose + hosts: srpmproc + become: true + become_user: root + vars_files: + - "vars/common.yml" + + pre_tasks: + - name: "Verify vars are set" + ansible.builtin.assert: + that: + - release_ver|int >= 8 + - (release_type|lower == 'stable') or (release_type|lower == 'lh') or (release_type|lower == 'beta') + success_msg: "We are ready to compose" + fail_msg: "release_ver or release_type is not set correctly." + + tasks: + - name: "Run compose operation" + import_tasks: tasks/compose.yml +... diff --git a/adhoc-compose-sync-generate-filelist.yml b/adhoc-compose-sync-generate-filelist.yml index e5f0c75..6b45460 100644 --- a/adhoc-compose-sync-generate-filelist.yml +++ b/adhoc-compose-sync-generate-filelist.yml @@ -1,6 +1,5 @@ --- # This playbook is meant to be used with callable variables, like adhoc or AWX. -# What: Creates a simple koji tag. That's it. - name: Generate file list hosts: srpmproc become: true diff --git a/adhoc-compose-sync-production.yml b/adhoc-compose-sync-production.yml index 3627b68..46d066a 100644 --- a/adhoc-compose-sync-production.yml +++ b/adhoc-compose-sync-production.yml @@ -1,6 +1,5 @@ --- # This playbook is meant to be used with callable variables, like adhoc or AWX. -# What: Creates a simple koji tag. That's it. - name: Sync a compose to staging hosts: srpmproc become: true diff --git a/adhoc-compose-sync-staging.yml b/adhoc-compose-sync-staging.yml index 4fb0c70..c4233a1 100644 --- a/adhoc-compose-sync-staging.yml +++ b/adhoc-compose-sync-staging.yml @@ -1,6 +1,5 @@ --- # This playbook is meant to be used with callable variables, like adhoc or AWX. -# What: Creates a simple koji tag. That's it. - name: Sync a compose to staging hosts: srpmproc become: true diff --git a/tasks/sync/sync_to_prod.yml b/tasks/sync/sync_to_prod.yml index de4014e..d40c914 100644 --- a/tasks/sync/sync_to_prod.yml +++ b/tasks/sync/sync_to_prod.yml @@ -12,13 +12,4 @@ failed_when: "result.rc != 0" when: - release_ver is defined - - release_ver == "8" - -- name: "Sync {{ release_ver }} to production (new)" - ansible.builtin.shell: "/bin/bash /root/sync-devel/sync/sync-to-prod.delete.sh" - changed_when: 1 != 1 - failed_when: "result.rc != 0" - when: - - release_ver is defined - - release_ver >= "9" ... diff --git a/tasks/sync/sync_to_staging.yml b/tasks/sync/sync_to_staging.yml index 3f8c625..03ad624 100644 --- a/tasks/sync/sync_to_staging.yml +++ b/tasks/sync/sync_to_staging.yml @@ -20,5 +20,5 @@ failed_when: "result.rc != 0" when: - release_ver is defined - - release_ver >= "9" + - release_ver|int >= 9 ...