diff --git a/adhoc-compose-sync-generate-filelist.yml b/adhoc-compose-sync-generate-filelist.yml new file mode 100644 index 0000000..e5f0c75 --- /dev/null +++ b/adhoc-compose-sync-generate-filelist.yml @@ -0,0 +1,16 @@ +--- +# 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 + become_user: koji + vars_files: + - "vars/common.yml" + environment: + RLVER: "{{ release_ver }}" + + tasks: + - name: "Generate file list" + import_tasks: tasks/sync/generate_filelist.yml +... diff --git a/adhoc-compose-sync-production.yml b/adhoc-compose-sync-production.yml new file mode 100644 index 0000000..3627b68 --- /dev/null +++ b/adhoc-compose-sync-production.yml @@ -0,0 +1,16 @@ +--- +# 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 + become_user: koji + vars_files: + - "vars/common.yml" + environment: + RLVER: "{{ release_ver }}" + + tasks: + - name: "Sync from staging to production" + import_tasks: tasks/sync/sync_to_prod.yml +... diff --git a/adhoc-compose-sync-staging.yml b/adhoc-compose-sync-staging.yml new file mode 100644 index 0000000..4fb0c70 --- /dev/null +++ b/adhoc-compose-sync-staging.yml @@ -0,0 +1,16 @@ +--- +# 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 + become_user: koji + vars_files: + - "vars/common.yml" + environment: + RLVER: "{{ release_ver }}" + + tasks: + - name: "Sync from latest to staging" + import_tasks: tasks/sync/sync_to_staging.yml +... diff --git a/roles/requirements.yml b/roles/requirements.yml index de8f3bd..bc3c11b 100644 --- a/roles/requirements.yml +++ b/roles/requirements.yml @@ -1,3 +1,3 @@ --- -# none +[] ... diff --git a/tasks/sync/generate_filelist.yml b/tasks/sync/generate_filelist.yml new file mode 100644 index 0000000..7a7e52b --- /dev/null +++ b/tasks/sync/generate_filelist.yml @@ -0,0 +1,13 @@ +--- +- name: "Make sure the sync repo are up to date" + ansible.builtin.git: + repo: https://git.resf.org/sig_core/toolkit.git + dest: /root/sync-devel + update: true + version: devel + +- name: "Generate file list" + ansible.builtin.shell: "/bin/bash /root/sync-devel/sync-file-list-parallel.sh" + changed_when: 1 != 1 + failed_when: "result.rc != 0" +... diff --git a/tasks/sync/sync_to_prod.yml b/tasks/sync/sync_to_prod.yml new file mode 100644 index 0000000..72cb924 --- /dev/null +++ b/tasks/sync/sync_to_prod.yml @@ -0,0 +1,24 @@ +--- +- name: "Make sure the sync repo are up to date" + ansible.builtin.git: + repo: https://git.resf.org/sig_core/toolkit.git + dest: /root/sync-devel + update: true + version: devel + +- name: "Sync {{ release_ver }} to production" + ansible.builtin.shell: "/bin/bash /root/sync-devel/sync/sync-to-prod.sh" + changed_when: 1 != 1 + 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 new file mode 100644 index 0000000..c40d48e --- /dev/null +++ b/tasks/sync/sync_to_staging.yml @@ -0,0 +1,24 @@ +--- +- name: "Make sure the sync repo are up to date" + ansible.builtin.git: + repo: https://git.resf.org/sig_core/toolkit.git + dest: /root/sync-devel + update: true + version: devel + +- name: "Sync {{ release_ver }} to staging" + ansible.builtin.shell: "/bin/bash /root/sync-devel/sync/sync-to-staging.sh Rocky" + changed_when: 1 != 1 + failed_when: "result.rc != 0" + when: + - release_ver is defined + - release_ver == "8" + +- name: "Sync {{ release_ver }} to staging (new)" + ansible.builtin.shell: "/bin/bash /root/sync-devel/sync/sync-to-staging.delete.sh Rocky" + changed_when: 1 != 1 + failed_when: "result.rc != 0" + when: + - release_ver is defined + - release_ver != "9" +...