139 lines
6.4 KiB
YAML
139 lines
6.4 KiB
YAML
# Copyright 2015 Red Hat, Inc.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
# License for the specific language governing permissions and limitations
|
|
# under the License.
|
|
---
|
|
- hosts: all
|
|
vars:
|
|
rolename: ansible-role-zuul-registry
|
|
zuul_registry_file_ssl_cert_content: |
|
|
-----BEGIN CERTIFICATE-----
|
|
MIIDTzCCAjcCFBfoHAg0EQQloogrr6mpLimi+YUJMA0GCSqGSIb3DQEBCwUAMGIx
|
|
CzAJBgNVBAYTAlVTMQ4wDAYDVQQIDAVUZXhhczEPMA0GA1UEBwwGQXVzdGluMR0w
|
|
GwYDVQQKDBRPcGVuU3RhY2sgRm91bmRhdGlvbjETMBEGA1UEAwwKZ2Vhcm1hbi1j
|
|
YTAeFw0yMDExMTcyMTIxMzVaFw0zMDExMTUyMTIxMzVaMGYxCzAJBgNVBAYTAlVT
|
|
MQ4wDAYDVQQIDAVUZXhhczEPMA0GA1UEBwwGQXVzdGluMR0wGwYDVQQKDBRPcGVu
|
|
U3RhY2sgRm91bmRhdGlvbjEXMBUGA1UEAwwOZ2Vhcm1hbi1jbGllbnQwggEiMA0G
|
|
CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC4cIGCILH7E15Pl0tK6TUKd/8DlsQW
|
|
R+sUju2pSwETz+/sW3TFWcWacS91BX8A3uMuneLTf1xgN/IhH/z4/6+XQi4BUN1a
|
|
/vI8t2xOWAFgq9h9pM2GvYTlPJC2Xj4vTONdZSEIPJE5d/QYpNzHA/NKlQq61A1n
|
|
/bdTALRxdPEeGLF63uY/kiiU+Ut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M4wyQxtoSb8Ns1o9s0m1A2X3iP/dHFZEmiilUCgYEA2tzCS7zu6VXaBXFq
|
|
CwhImmNmBWMrncx7TeCLL2UGxl53z6hmNTZ2N216O+cNItpXeBWmjbyDK1wyLAug
|
|
7fLNnW3xMlIRNaqo5qkoj1iPyaYzAz/RfhIjSH7EHHcm0L5HssjanOGW9YOpTpqv
|
|
4VFGmzIrdzue1QSi4qkP8DuY7Nk=
|
|
-----END PRIVATE KEY-----
|
|
|
|
roles:
|
|
- "{{ rolename }}"
|
|
|
|
post_tasks:
|
|
- name: Assert results are registered.
|
|
assert:
|
|
that:
|
|
- zuul_registry_file_registry_yaml
|
|
- zuul_registry_file_zuul_registry_service
|
|
- zuul_registry_file_zuul_registry_service_config
|
|
- zuul_registry_service_zuul_registry
|
|
|
|
- name: Register zuul_registry_git_dest_stat.
|
|
stat:
|
|
path: /home/zuul/src/opendev.org/zuul/zuul-registry
|
|
register: zuul_registry_git_dest_stat
|
|
when: zuul_registry_install_method == 'git'
|
|
|
|
- name: Assert zuul_registry_git_dest tests.
|
|
assert:
|
|
that:
|
|
- zuul_registry_git_dest_stat.stat.exists
|
|
- zuul_registry_git_dest_stat.stat.isdir
|
|
when: zuul_registry_install_method == 'git'
|
|
|
|
- name: Register /etc/cron.d/zuul-registry
|
|
stat:
|
|
path: /etc/cron.d/zuul-registry
|
|
register: zuul_registry_crontab_stat
|
|
|
|
- name: Assert zuul_registry_crontab_stat tests
|
|
assert:
|
|
that:
|
|
- zuul_registry_crontab_stat.stat.exists
|
|
- zuul_registry_crontab_stat.stat.isreg
|
|
- zuul_registry_crontab_stat.stat.pw_name == 'root'
|
|
- zuul_registry_crontab_stat.stat.gr_name == 'root'
|
|
|
|
- name: Register /etc/systemd/system/zuul-registry.service
|
|
stat:
|
|
path: /etc/systemd/system/zuul-registry.service
|
|
register: _zuul_registry_service_systemd_stat
|
|
|
|
- name: Assert _zuul_registry_service_systemd_stat tests.
|
|
assert:
|
|
that:
|
|
- _zuul_registry_service_systemd_stat.stat.exists
|
|
- _zuul_registry_service_systemd_stat.stat.isreg
|
|
- _zuul_registry_service_systemd_stat.stat.pw_name == 'root'
|
|
- _zuul_registry_service_systemd_stat.stat.gr_name == 'root'
|
|
- _zuul_registry_service_systemd_stat.stat.mode == '0644'
|
|
|
|
- name: Register /etc/systemd/system/zuul-registry.service.d/override.conf
|
|
stat:
|
|
path: /etc/systemd/system/zuul-registry.service.d/override.conf
|
|
register: zuul_registry_service_config_stat
|
|
|
|
- name: Assert zuul_registry_service_config_stat tests.
|
|
assert:
|
|
that:
|
|
- zuul_registry_service_config_stat.stat.exists
|
|
- zuul_registry_service_config_stat.stat.isreg
|
|
- zuul_registry_service_config_stat.stat.pw_name == 'root'
|
|
- zuul_registry_service_config_stat.stat.gr_name == 'root'
|
|
- zuul_registry_service_config_stat.stat.mode == '0644'
|
|
|
|
- name: Ensure zuul-registry is running
|
|
become: true
|
|
shell: /usr/sbin/service zuul-registry status
|
|
tags: skip_ansible_lint
|