ansible/playbooks/groups/oci-registry.yml

98 lines
2.8 KiB
YAML
Raw Normal View History

2016-03-14 23:43:00 +00:00
# create an osbs server
- 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
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
- nagios_client
2016-03-14 23:43:00 +00:00
- hosts
- fas_client
- collectd/base
- rsyncd
- sudo
- { role: openvpn/client,
when: env != "staging" }
- { role: nfs/client,
mnt_dir: '/srv/registry',
nfs_src_dir: "oci_registry",
when: "env != 'staging' or 'candidate' not in inventory_hostname" }
2016-03-14 23:43:00 +00:00
pre_tasks:
- name: Create /srv/registry on staging and candidate since it does not use NFS
file:
path: /srv/registry
state: directory
owner: root
group: root
mode: 0755
when: "env == 'staging' or 'candidate' not in inventory_hostname"
- import_tasks: "{{ tasks_path }}/yumrepos.yml"
tasks:
- 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"
- name: setup docker distribution registry
hosts: oci_registry:oci_registry_stg
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
# will be SSL enabled.
roles:
- {
role: docker-distribution,
conf_path: "/etc/docker-distribution/registry/config.yml",
tls: {
enabled: False,
},
log: {
fields: {
service: "registry"
}
},
storage: {
filesystem: {
rootdirectory: "/srv/registry"
}
},
http: {
addr: ":5000"
}
}
# Setup compose-x86-01 push docker images to registry
- {
role: push-docker,
candidate_registry: "candidate-registry.stg.fedoraproject.org",
candidate_registry_osbs_username: "{{candidate_registry_osbs_stg_username}}",
candidate_registry_osbs_password: "{{candidate_registry_osbs_stg_password}}",
when: env == "staging",
delegate_to: compose-x86-01.phx2.fedoraproject.org
}
- {
role: push-docker,
candidate_registry: "candidate-registry.fedoraproject.org",
candidate_registry_osbs_username: "{{candidate_registry_osbs_prod_username}}",
candidate_registry_osbs_password: "{{candidate_registry_osbs_prod_password}}",
when: env == "production",
delegate_to: compose-x86-01.phx2.fedoraproject.org
}