| 1 |
--- |
| 2 |
- hosts: localhost |
| 3 |
collections: |
| 4 |
- theforeman.foreman |
| 5 |
gather_facts: false |
| 6 |
vars_files: |
| 7 |
- vars/server.yml |
| 8 |
tasks: |
| 9 |
- include_tasks: tasks/organization.yml |
| 10 |
vars: |
| 11 |
organization_state: present |
| 12 |
- include_tasks: tasks/product.yml |
| 13 |
vars: |
| 14 |
product_state: present |
| 15 |
- include_tasks: tasks/repository.yml |
| 16 |
vars: |
| 17 |
repository_state: present |
| 18 |
- include_tasks: tasks/lifecycle_environment.yml |
| 19 |
vars: |
| 20 |
lifecycle_environment_state: present |
| 21 |
lifecycle_environment_name: "{{ item.name }}" |
| 22 |
lifecycle_environment_label: "{{ item.label }}" |
| 23 |
lifecycle_environment_prior: "{{ item.prior }}" |
| 24 |
loop: |
| 25 |
- name: Test |
| 26 |
label: test |
| 27 |
prior: Library |
| 28 |
- name: QA |
| 29 |
label: qa |
| 30 |
prior: Test |
| 31 |
- name: Prod |
| 32 |
label: prod |
| 33 |
prior: QA |
| 34 |
- import_tasks: tasks/content_view_version.yml |
| 35 |
vars: |
| 36 |
state: absent |
| 37 |
version: 1.0 |
| 38 |
ignore_errors: true |
| 39 |
- include_tasks: tasks/content_view.yml |
| 40 |
vars: |
| 41 |
content_view_state: present |
| 42 |
repositories: |
| 43 |
- name: "Test Repository" |
| 44 |
product: "Test Product" |
| 45 |
|
| 46 |
- hosts: tests |
| 47 |
collections: |
| 48 |
- theforeman.foreman |
| 49 |
gather_facts: false |
| 50 |
vars_files: |
| 51 |
- vars/server.yml |
| 52 |
tasks: |
| 53 |
- name: publish CV version 1.0 |
| 54 |
include_tasks: tasks/content_view_version.yml |
| 55 |
vars: |
| 56 |
description: version-1.0 |
| 57 |
version: 1.0 |
| 58 |
expected_change: true |
| 59 |
- name: publish CV version 1.0 again, no change |
| 60 |
include_tasks: tasks/content_view_version.yml |
| 61 |
vars: |
| 62 |
description: version-1.0 |
| 63 |
version: 1.0 |
| 64 |
lifecycle_environments: |
| 65 |
- Library |
| 66 |
expected_change: false |
| 67 |
- name: publish CV to Library again, no change |
| 68 |
include_tasks: tasks/content_view_version.yml |
| 69 |
vars: |
| 70 |
description: version-1.0 |
| 71 |
version: 1.0 |
| 72 |
lifecycle_environments: |
| 73 |
- Library |
| 74 |
expected_change: false |
| 75 |
- name: publish CV version 2.0 |
| 76 |
include_tasks: tasks/content_view_version.yml |
| 77 |
vars: |
| 78 |
description: version-2.0 |
| 79 |
version: 2.0 |
| 80 |
expected_change: true |
| 81 |
- name: remove cv version 1.0 |
| 82 |
include_tasks: tasks/content_view_version.yml |
| 83 |
vars: |
| 84 |
version: 1.0 |
| 85 |
state: absent |
| 86 |
expected_change: true |
| 87 |
- name: remove cv version 1.0 again, no change |
| 88 |
include_tasks: tasks/content_view_version.yml |
| 89 |
vars: |
| 90 |
version: 1.0 |
| 91 |
state: absent |
| 92 |
expected_change: false |
| 93 |
- name: promote CV from Library to Test |
| 94 |
include_tasks: tasks/content_view_version.yml |
| 95 |
vars: |
| 96 |
current_lifecycle_environment: Library |
| 97 |
lifecycle_environments: |
| 98 |
- Library |
| 99 |
- Test |
| 100 |
expected_change: true |
| 101 |
- name: promote CV from Library to Test again, no change |
| 102 |
include_tasks: tasks/content_view_version.yml |
| 103 |
vars: |
| 104 |
current_lifecycle_environment: Library |
| 105 |
lifecycle_environments: |
| 106 |
- Library |
| 107 |
- Test |
| 108 |
expected_change: false |
| 109 |
- name: force promote CV from Test to Prod |
| 110 |
include_tasks: tasks/content_view_version.yml |
| 111 |
vars: |
| 112 |
current_lifecycle_environment: Test |
| 113 |
lifecycle_environments: |
| 114 |
- Library |
| 115 |
- Test |
| 116 |
- Prod |
| 117 |
force_promote: true |
| 118 |
expected_change: true |
| 119 |
- name: force promote CV from Test to Prod again, no change |
| 120 |
include_tasks: tasks/content_view_version.yml |
| 121 |
vars: |
| 122 |
current_lifecycle_environment: Test |
| 123 |
lifecycle_environments: |
| 124 |
- Library |
| 125 |
- Test |
| 126 |
- Prod |
| 127 |
force_promote: true |
| 128 |
expected_change: false |
| 129 |
|
| 130 |
- hosts: localhost |
| 131 |
collections: |
| 132 |
- theforeman.foreman |
| 133 |
gather_facts: false |
| 134 |
vars_files: |
| 135 |
- vars/server.yml |
| 136 |
tasks: |
| 137 |
- include_tasks: tasks/content_view_version.yml |
| 138 |
vars: |
| 139 |
state: absent |
| 140 |
version: 1.0 |
| 141 |
ignore_errors: true |
| 142 |
- include_tasks: tasks/content_view.yml |
| 143 |
vars: |
| 144 |
content_view_state: absent |
| 145 |
ignore_errors: true |
| 146 |
- include_tasks: tasks/repository.yml |
| 147 |
vars: |
| 148 |
repository_state: absent |
| 149 |
ignore_errors: true |
| 150 |
- include_tasks: tasks/product.yml |
| 151 |
vars: |
| 152 |
product_state: absent |
| 153 |
ignore_errors: true |
| 154 |
- include_tasks: tasks/organization.yml |
| 155 |
vars: |
| 156 |
organization_state: absent |