| 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/content_credential.yml |
| 13 |
vars: |
| 14 |
content_credential_name: "Test GPG key" |
| 15 |
content_credential_type: "gpg_key" |
| 16 |
content_credential_content: "key" |
| 17 |
content_credential_state: present |
| 18 |
- include_tasks: tasks/content_credential.yml |
| 19 |
vars: |
| 20 |
content_credential_name: "Test SSL Cert" |
| 21 |
content_credential_type: "cert" |
| 22 |
content_credential_content: | |
| 23 |
-----BEGIN CERTIFICATE----- |
| 24 |
MIICoDCCAYgCCQC2c2uY34HNlzANBgkqhkiG9w0BAQUFADASMRAwDgYDVQQDDAdn |
| 25 |
b3ZlZ2FuMB4XDTE5MDMxMzIxMDMzMFoXDTM4MDYxNjIxMDMzMFowEjEQMA4GA1UE |
| 26 |
AwwHZ292ZWdhbjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANEatWsZ |
| 27 |
1iwGmTxD02dxMI4ci+Au4FzvmWLBWD07H5GGTVFwnqmNOKhP6DHs1EsMZevkUvaG |
| 28 |
CRxZlPYhjNFLZr2c2FnoDZ5nBXlSW6sodXURbMfyT187nDeBXVYFuh4T2eNCatnm |
| 29 |
t3vgdi+pWsF0LbOgpu7GJI2sh5K1imxyB77tJ7PFTDZCSohkK+A+0nDCnJqDUNXD |
| 30 |
5CK8iaBciCbnzp3nRKuM2EmgXno9Repy/HYxIgB7ZodPwDvYNjMGfvs0s9mJIKmc |
| 31 |
CKgkPXVO9y9gaRrrytICcPOs+YoU/PN4Ttg6wzxaWvJgw44vsR8wM/0i4HlXfBdl |
| 32 |
9br+cgn8jukDOgECAwEAATANBgkqhkiG9w0BAQUFAAOCAQEAyNHV6NA+0GfUrvBq |
| 33 |
AHXHNnBE3nzMhGPhF/0B/dO4o0n6pgGZyzRxaUaoo6+5oQnBf/2NmDyLWdalFWX7 |
| 34 |
D1WBaxkhK+FU922+qwQKhABlwMxGCnfZ8F+rlk4lNotm3fP4wHbnO1SGIDvvZFt/ |
| 35 |
mpMgkhwL4lShUFv57YylXr+D2vSFcAryKiVGk1X3sHMXlFAMLHUm3d97fJnmb1qQ |
| 36 |
wC43BlJCBQF98wKtYNwTUG/9gblfk8lCB2DL1hwmPy3q9KbSDOdUK3HW6a75ZzCD |
| 37 |
6mXc/Y0bJcwweDsywbPBYP13hYUcpw4htcU6hg6DsoAjLNkSrlY+GGo7htx+L9HH |
| 38 |
IwtfRg== |
| 39 |
-----END CERTIFICATE----- |
| 40 |
content_credential_state: present |
| 41 |
- include_tasks: tasks/product.yml |
| 42 |
vars: |
| 43 |
product_state: present |
| 44 |
- include_tasks: tasks/repository.yml |
| 45 |
vars: |
| 46 |
repository_state: absent |
| 47 |
repository_name: "{{ item }}" |
| 48 |
loop: |
| 49 |
- "Test Repository" |
| 50 |
- "Test Repository 2" |
| 51 |
- "Test Docker Repository" |
| 52 |
|
| 53 |
- hosts: tests |
| 54 |
collections: |
| 55 |
- theforeman.foreman |
| 56 |
gather_facts: false |
| 57 |
vars_files: |
| 58 |
- vars/server.yml |
| 59 |
tasks: |
| 60 |
- name: Test Yum Repository |
| 61 |
block: |
| 62 |
- include_tasks: tasks/repository.yml |
| 63 |
vars: |
| 64 |
repository_state: present |
| 65 |
expected_change: true |
| 66 |
repository_label: "just_a_test_repo" |
| 67 |
repository_mirroring_policy: additive |
| 68 |
repository_url: "https://fixtures.pulpproject.org/rpm-signed/" |
| 69 |
- include_tasks: tasks/repository.yml |
| 70 |
vars: |
| 71 |
repository_state: present |
| 72 |
repository_mirroring_policy: additive |
| 73 |
expected_change: false |
| 74 |
- include_tasks: tasks/repository.yml |
| 75 |
vars: |
| 76 |
repository_state: present |
| 77 |
repository_mirroring_policy: mirror_content_only |
| 78 |
expected_change: true |
| 79 |
- include_tasks: tasks/repository.yml |
| 80 |
vars: |
| 81 |
repository_state: present |
| 82 |
repository_mirroring_policy: mirror_content_only |
| 83 |
expected_change: false |
| 84 |
- include_tasks: tasks/repository.yml |
| 85 |
vars: |
| 86 |
repository_url: 'https://localhost/pulp/repos/demo_repos/zoo' |
| 87 |
repository_download_policy: "immediate" |
| 88 |
repository_state: present |
| 89 |
expected_change: true |
| 90 |
- include_tasks: tasks/repository.yml |
| 91 |
vars: |
| 92 |
repository_download_concurrency: 10 |
| 93 |
repository_state: present |
| 94 |
expected_change: true |
| 95 |
- include_tasks: tasks/repository.yml |
| 96 |
vars: |
| 97 |
repository_download_concurrency: 10 |
| 98 |
repository_state: present |
| 99 |
expected_change: true |
| 100 |
- include_tasks: tasks/repository.yml |
| 101 |
vars: |
| 102 |
repository_state: absent |
| 103 |
expected_change: true |
| 104 |
- include_tasks: tasks/repository.yml |
| 105 |
vars: |
| 106 |
repository_state: absent |
| 107 |
expected_change: false |
| 108 |
|
| 109 |
- name: Test Yum Repository with content SSL and GPG key |
| 110 |
block: |
| 111 |
- include_tasks: tasks/repository.yml |
| 112 |
vars: |
| 113 |
repository_state: present |
| 114 |
expected_change: true |
| 115 |
repository_name: "Test Repository 2" |
| 116 |
repository_label: "just_a_test_repo2" |
| 117 |
repository_gpg_key: "Test GPG key" |
| 118 |
repository_ssl_ca_cert: "Test SSL Cert" |
| 119 |
repository_ssl_client_cert: "Test SSL Cert" |
| 120 |
repository_ssl_client_key: "Test SSL Cert" |
| 121 |
repository_mirroring_policy: additive |
| 122 |
repository_url: "https://fixtures.pulpproject.org/rpm-signed/" |
| 123 |
- include_tasks: tasks/repository.yml |
| 124 |
vars: |
| 125 |
repository_state: present |
| 126 |
repository_mirroring_policy: additive |
| 127 |
expected_change: false |
| 128 |
repository_name: "Test Repository 2" |
| 129 |
- include_tasks: tasks/repository.yml |
| 130 |
vars: |
| 131 |
repository_state: present |
| 132 |
repository_mirroring_policy: mirror_content_only |
| 133 |
expected_change: true |
| 134 |
repository_name: "Test Repository 2" |
| 135 |
- include_tasks: tasks/repository.yml |
| 136 |
vars: |
| 137 |
repository_state: present |
| 138 |
repository_mirroring_policy: mirror_content_only |
| 139 |
expected_change: false |
| 140 |
repository_name: "Test Repository 2" |
| 141 |
- include_tasks: tasks/repository.yml |
| 142 |
vars: |
| 143 |
repository_state: present |
| 144 |
repository_gpg_key: "" |
| 145 |
repository_ssl_ca_cert: "" |
| 146 |
repository_ssl_client_cert: "" |
| 147 |
repository_ssl_client_key: "" |
| 148 |
expected_change: true |
| 149 |
repository_name: "Test Repository 2" |
| 150 |
- include_tasks: tasks/repository.yml |
| 151 |
vars: |
| 152 |
repository_state: present |
| 153 |
repository_gpg_key: "" |
| 154 |
repository_ssl_ca_cert: "" |
| 155 |
repository_ssl_client_cert: "" |
| 156 |
repository_ssl_client_key: "" |
| 157 |
expected_change: false |
| 158 |
repository_name: "Test Repository 2" |
| 159 |
- include_tasks: tasks/repository.yml |
| 160 |
vars: |
| 161 |
repository_state: absent |
| 162 |
expected_change: true |
| 163 |
repository_name: "Test Repository 2" |
| 164 |
- include_tasks: tasks/repository.yml |
| 165 |
vars: |
| 166 |
repository_state: absent |
| 167 |
expected_change: false |
| 168 |
repository_name: "Test Repository 2" |
| 169 |
|
| 170 |
- name: Test Docker Repository |
| 171 |
block: |
| 172 |
- include_tasks: tasks/repository.yml |
| 173 |
vars: |
| 174 |
repository_state: present |
| 175 |
repository_label: "just_a_test_repo" |
| 176 |
repository_name: Test Docker Repository |
| 177 |
repository_content_type: docker |
| 178 |
repository_url: https://docker.io |
| 179 |
repository_docker_upstream_name: busybox |
| 180 |
repository_include_tags: |
| 181 |
- latest |
| 182 |
expected_change: true |
| 183 |
- include_tasks: tasks/repository.yml |
| 184 |
vars: |
| 185 |
repository_state: present |
| 186 |
repository_name: Test Docker Repository |
| 187 |
repository_content_type: docker |
| 188 |
repository_url: https://docker.io |
| 189 |
repository_docker_upstream_name: busybox |
| 190 |
repository_include_tags: |
| 191 |
- latest |
| 192 |
expected_change: false |
| 193 |
- include_tasks: tasks/repository.yml |
| 194 |
vars: |
| 195 |
repository_state: present |
| 196 |
repository_name: Test Docker Repository |
| 197 |
repository_content_type: docker |
| 198 |
repository_url: https://docker.io |
| 199 |
repository_upstream_username: dockeruser |
| 200 |
repository_upstream_password: dockerpass |
| 201 |
repository_docker_upstream_name: busybox |
| 202 |
repository_include_tags: |
| 203 |
- latest |
| 204 |
expected_change: true |
| 205 |
- include_tasks: tasks/repository.yml |
| 206 |
vars: |
| 207 |
repository_state: absent |
| 208 |
repository_name: Test Docker Repository |
| 209 |
repository_content_type: docker |
| 210 |
|
| 211 |
- hosts: localhost |
| 212 |
collections: |
| 213 |
- theforeman.foreman |
| 214 |
gather_facts: false |
| 215 |
vars_files: |
| 216 |
- vars/server.yml |
| 217 |
tasks: |
| 218 |
- include_tasks: tasks/content_credential.yml |
| 219 |
vars: |
| 220 |
content_credential_name: "Test SSL Cert" |
| 221 |
content_credential_type: "cert" |
| 222 |
content_credential_state: absent |
| 223 |
- include_tasks: tasks/content_credential.yml |
| 224 |
vars: |
| 225 |
content_credential_state: absent |
| 226 |
- include_tasks: tasks/product.yml |
| 227 |
vars: |
| 228 |
product_state: absent |
| 229 |
- include_tasks: tasks/organization.yml |
| 230 |
vars: |
| 231 |
organization_state: absent |
| 232 |
... |