|
| 1 | +--- |
| 2 | +- name: Create VMAAS database secrets |
| 3 | + containers.podman.podman_secret: |
| 4 | + name: "{{ item.name }}" |
| 5 | + data: "{{ item.data }}" |
| 6 | + state: present |
| 7 | + loop: |
| 8 | + - name: "iop-service-vmaas-reposcan-database-username" |
| 9 | + data: "{{ iop_vmaas_database_user }}" |
| 10 | + - name: "iop-service-vmaas-reposcan-database-password" |
| 11 | + data: "{{ iop_vmaas_database_password }}" |
| 12 | + - name: "iop-service-vmaas-reposcan-database-name" |
| 13 | + data: "{{ iop_vmaas_database_name }}" |
| 14 | + - name: "iop-service-vmaas-reposcan-database-host" |
| 15 | + data: "{{ iop_vmaas_database_host }}" |
| 16 | + - name: "iop-service-vmaas-reposcan-database-port" |
| 17 | + data: "{{ iop_vmaas_database_port }}" |
| 18 | + no_log: true |
| 19 | + |
| 20 | +- name: Create VMAAS data volume |
| 21 | + containers.podman.podman_volume: |
| 22 | + name: iop-service-vmaas-data |
| 23 | + state: present |
| 24 | + |
| 25 | +- name: Deploy VMAAS Reposcan container |
| 26 | + containers.podman.podman_container: |
| 27 | + name: iop-service-vmaas-reposcan |
| 28 | + image: "{{ iop_vmaas_container_image }}:{{ iop_vmaas_container_tag }}" |
| 29 | + state: quadlet |
| 30 | + quadlet_dir: /etc/containers/systemd |
| 31 | + network: iop-core-network |
| 32 | + volumes: |
| 33 | + - iop-service-vmaas-data:/data |
| 34 | + command: "/vmaas/entrypoint.sh database-upgrade reposcan" |
| 35 | + env: |
| 36 | + PROMETHEUS_PORT: "8085" |
| 37 | + PROMETHEUS_MULTIPROC_DIR: "/tmp/prometheus_multiproc_dir" |
| 38 | + SYNC_REPO_LIST_SOURCE: "katello" |
| 39 | + SYNC_REPOS: "yes" |
| 40 | + SYNC_CVE_MAP: "yes" |
| 41 | + SYNC_CPE: "no" |
| 42 | + SYNC_CSAF: "no" |
| 43 | + SYNC_RELEASES: "no" |
| 44 | + SYNC_RELEASE_GRAPH: "no" |
| 45 | + KATELLO_URL: "http://iop-core-gateway:9090" |
| 46 | + REDHAT_CVEMAP_URL: "http://iop-core-gateway:9090/pub/iop/data/meta/v1/cvemap.xml" |
| 47 | + POSTGRESQL_SSL_MODE: "disable" |
| 48 | + secrets: |
| 49 | + - "iop-service-vmaas-reposcan-database-username,type=env,target=POSTGRESQL_USER" |
| 50 | + - "iop-service-vmaas-reposcan-database-password,type=env,target=POSTGRESQL_PASSWORD" |
| 51 | + - "iop-service-vmaas-reposcan-database-name,type=env,target=POSTGRESQL_DATABASE" |
| 52 | + - "iop-service-vmaas-reposcan-database-host,type=env,target=POSTGRESQL_HOST" |
| 53 | + - "iop-service-vmaas-reposcan-database-port,type=env,target=POSTGRESQL_PORT" |
| 54 | + quadlet_options: |
| 55 | + - | |
| 56 | + [Unit] |
| 57 | + Description=VMAAS Reposcan Service |
| 58 | + [Service] |
| 59 | + Restart=on-failure |
| 60 | + Environment=REGISTRY_AUTH_FILE=/etc/foreman/registry-auth.json |
| 61 | + [Install] |
| 62 | + WantedBy=default.target |
| 63 | +
|
| 64 | +- name: Deploy VMAAS Webapp-Go container |
| 65 | + containers.podman.podman_container: |
| 66 | + name: iop-service-vmaas-webapp-go |
| 67 | + image: "{{ iop_vmaas_container_image }}:{{ iop_vmaas_container_tag }}" |
| 68 | + state: quadlet |
| 69 | + quadlet_dir: /etc/containers/systemd |
| 70 | + network: iop-core-network |
| 71 | + command: "/vmaas/entrypoint.sh webapp-go" |
| 72 | + env: |
| 73 | + REPOSCAN_PUBLIC_URL: "http://iop-service-vmaas-reposcan:8000" |
| 74 | + REPOSCAN_PRIVATE_URL: "http://iop-service-vmaas-reposcan:10000" |
| 75 | + CSAF_UNFIXED_EVAL_ENABLED: "FALSE" |
| 76 | + GIN_MODE: "release" |
| 77 | + POSTGRESQL_SSL_MODE: "disable" |
| 78 | + secrets: |
| 79 | + - "iop-service-vmaas-reposcan-database-username,type=env,target=POSTGRESQL_USER" |
| 80 | + - "iop-service-vmaas-reposcan-database-password,type=env,target=POSTGRESQL_PASSWORD" |
| 81 | + - "iop-service-vmaas-reposcan-database-name,type=env,target=POSTGRESQL_DATABASE" |
| 82 | + - "iop-service-vmaas-reposcan-database-host,type=env,target=POSTGRESQL_HOST" |
| 83 | + - "iop-service-vmaas-reposcan-database-port,type=env,target=POSTGRESQL_PORT" |
| 84 | + quadlet_options: |
| 85 | + - | |
| 86 | + [Unit] |
| 87 | + Description=VMAAS Webapp-Go Service |
| 88 | + Wants=iop-service-vmaas-reposcan.service |
| 89 | + After=iop-service-vmaas-reposcan.service |
| 90 | + [Service] |
| 91 | + Restart=on-failure |
| 92 | + Environment=REGISTRY_AUTH_FILE=/etc/foreman/registry-auth.json |
| 93 | + [Install] |
| 94 | + WantedBy=default.target |
| 95 | +
|
| 96 | +- name: Run daemon reload to make Quadlet create the service files |
| 97 | + ansible.builtin.systemd: |
| 98 | + daemon_reload: true |
| 99 | + |
| 100 | +- name: Start VMAAS Reposcan service |
| 101 | + ansible.builtin.systemd: |
| 102 | + name: iop-service-vmaas-reposcan |
| 103 | + enabled: true |
| 104 | + state: started |
| 105 | + |
| 106 | +- name: Start VMAAS Webapp-Go service |
| 107 | + ansible.builtin.systemd: |
| 108 | + name: iop-service-vmaas-webapp-go |
| 109 | + enabled: true |
| 110 | + state: started |
0 commit comments