2016-03-14 23:43:00 +00:00
|
|
|
# create an osbs server
|
2019-05-20 18:23:42 +00:00
|
|
|
- import_playbook: "/srv/web/infra/ansible/playbooks/include/virt-create.yml myhosts=oci_registry:oci_registry_stg"
|
2016-03-14 23:43:00 +00:00
|
|
|
|
|
|
|
- name: make the box be real
|
2019-05-20 17:36:07 +00:00
|
|
|
hosts: oci_registry:oci_registry_stg
|
2016-03-14 23:43:00 +00:00
|
|
|
user: root
|
|
|
|
gather_facts: True
|
|
|
|
|
|
|
|
vars_files:
|
|
|
|
- /srv/web/infra/ansible/vars/global.yml
|
|
|
|
- "/srv/private/ansible/vars.yml"
|
|
|
|
- /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml
|
|
|
|
|
|
|
|
roles:
|
|
|
|
- base
|
|
|
|
- rkhunter
|
2017-05-05 22:12:33 +00:00
|
|
|
- nagios_client
|
2016-03-14 23:43:00 +00:00
|
|
|
- hosts
|
|
|
|
- fas_client
|
|
|
|
- collectd/base
|
|
|
|
- rsyncd
|
|
|
|
- sudo
|
2016-07-12 17:19:38 +00:00
|
|
|
- { role: openvpn/client,
|
|
|
|
when: env != "staging" }
|
2018-10-04 15:31:12 +00:00
|
|
|
- { role: nfs/client,
|
|
|
|
mnt_dir: '/srv/registry',
|
|
|
|
nfs_src_dir: "oci_registry",
|
2020-01-07 20:50:31 +01:00
|
|
|
when: "env != 'staging' or 'candidate' not in inventory_hostname" }
|
2016-03-14 23:43:00 +00:00
|
|
|
|
2018-04-01 22:18:56 +00:00
|
|
|
pre_tasks:
|
2020-01-07 20:50:31 +01:00
|
|
|
- name: Create /srv/registry on staging and candidate since it does not use NFS
|
2018-10-04 17:41:47 +00:00
|
|
|
file:
|
|
|
|
path: /srv/registry
|
|
|
|
state: directory
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0755
|
2020-01-07 20:50:31 +01:00
|
|
|
when: "env == 'staging' or 'candidate' not in inventory_hostname"
|
2017-10-17 17:37:03 +00:00
|
|
|
- import_tasks: "{{ tasks_path }}/yumrepos.yml"
|
2018-04-01 22:18:56 +00:00
|
|
|
|
|
|
|
tasks:
|
2017-10-17 17:37:03 +00:00
|
|
|
- import_tasks: "{{ tasks_path }}/2fa_client.yml"
|
|
|
|
- import_tasks: "{{ tasks_path }}/motd.yml"
|
2016-03-14 23:43:00 +00:00
|
|
|
|
|
|
|
handlers:
|
2017-10-15 20:33:11 +00:00
|
|
|
- import_tasks: "{{ handlers_path }}/restart_services.yml"
|
2016-04-07 15:36:10 +00:00
|
|
|
|
|
|
|
- name: setup docker distribution registry
|
2019-05-20 17:36:07 +00:00
|
|
|
hosts: oci_registry:oci_registry_stg
|
2016-04-07 15:36:10 +00:00
|
|
|
vars_files:
|
|
|
|
- /srv/web/infra/ansible/vars/global.yml
|
|
|
|
- /srv/private/ansible/vars.yml
|
|
|
|
- /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml
|
|
|
|
|
|
|
|
|
|
|
|
# NOTE: tls is disabled for docker-distribution because we are listening only
|
|
|
|
# on localhost and all external connections will be through httpd which
|
2018-04-01 21:47:27 +00:00
|
|
|
# will be SSL enabled.
|
2016-04-07 15:36:10 +00:00
|
|
|
roles:
|
|
|
|
- {
|
|
|
|
role: docker-distribution,
|
|
|
|
conf_path: "/etc/docker-distribution/registry/config.yml",
|
|
|
|
tls: {
|
|
|
|
enabled: False,
|
|
|
|
},
|
|
|
|
log: {
|
|
|
|
fields: {
|
|
|
|
service: "registry"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
storage: {
|
|
|
|
filesystem: {
|
2018-10-04 18:07:09 +00:00
|
|
|
rootdirectory: "/srv/registry"
|
2016-04-07 15:57:06 +00:00
|
|
|
}
|
2016-04-07 15:36:10 +00:00
|
|
|
},
|
2016-04-12 14:33:37 +00:00
|
|
|
http: {
|
2016-04-12 14:51:16 +00:00
|
|
|
addr: ":5000"
|
2016-07-12 18:34:42 +00:00
|
|
|
}
|
2016-04-07 15:36:10 +00:00
|
|
|
}
|
2016-06-24 16:55:38 +00:00
|
|
|
|
2016-07-05 16:19:28 +00:00
|
|
|
# Setup compose-x86-01 push docker images to registry
|
2016-06-24 16:55:38 +00:00
|
|
|
- {
|
|
|
|
role: push-docker,
|
2018-06-08 11:49:04 +02:00
|
|
|
candidate_registry: "candidate-registry.stg.fedoraproject.org",
|
2018-06-08 11:56:49 +02:00
|
|
|
candidate_registry_osbs_username: "{{candidate_registry_osbs_stg_username}}",
|
|
|
|
candidate_registry_osbs_password: "{{candidate_registry_osbs_stg_password}}",
|
2016-08-29 20:27:50 +00:00
|
|
|
when: env == "staging",
|
|
|
|
delegate_to: compose-x86-01.phx2.fedoraproject.org
|
|
|
|
}
|
2016-06-24 16:55:38 +00:00
|
|
|
- {
|
|
|
|
role: push-docker,
|
2018-06-08 11:49:04 +02:00
|
|
|
candidate_registry: "candidate-registry.fedoraproject.org",
|
2018-06-08 11:56:49 +02:00
|
|
|
candidate_registry_osbs_username: "{{candidate_registry_osbs_prod_username}}",
|
|
|
|
candidate_registry_osbs_password: "{{candidate_registry_osbs_prod_password}}",
|
2016-09-02 14:24:33 +00:00
|
|
|
when: env == "production",
|
|
|
|
delegate_to: compose-x86-01.phx2.fedoraproject.org
|
|
|
|
}
|