pre-stage openshift docker images in our registry for osbs

Signed-off-by: Adam Miller <admiller@redhat.com>
This commit is contained in:
Adam Miller 2016-06-25 02:23:46 +00:00
parent 424b91148c
commit 110c556575
2 changed files with 51 additions and 17 deletions

View file

@ -6,7 +6,7 @@ datacenter: phx2
# usually we do not want to enable nested virt, only on some virthosts
nested: false
# most of our systems are 64bit.
# most of our systems are 64bit.
# Used to install various nagios scripts and the like.
libdir: /usr/lib64
@ -34,8 +34,8 @@ mem_size: 2048
num_cpus: 2
lvm_size: 20000
# Default netmask. Almost all our phx2 nets are /24's with the
# exception of 10.5.124.128/25. Almost all of our non phx2 sites are
# Default netmask. Almost all our phx2 nets are /24's with the
# exception of 10.5.124.128/25. Almost all of our non phx2 sites are
# less than a /24.
eth0_nm: 255.255.255.0
eth1_nm: 255.255.255.0
@ -51,7 +51,7 @@ virt_install_command: "{{ virt_install_command_one_nic }}"
main_bridge: br0
nfs_bridge: br1
virt_install_command_one_nic: virt-install -n {{ inventory_hostname }}
virt_install_command_one_nic: virt-install -n {{ inventory_hostname }}
--memory={{ mem_size }},maxmemory={{ max_mem_size }} --memballoon virtio
--disk bus=virtio,path={{ volgroup }}/{{ inventory_hostname }}
--vcpus={{ num_cpus }},maxvcpus={{ max_cpu }} -l {{ ks_repo }} -x
@ -61,7 +61,7 @@ virt_install_command_one_nic: virt-install -n {{ inventory_hostname }}
--network bridge={{ main_bridge }},model=virtio
--autostart --noautoconsole --watchdog default
virt_install_command_two_nic: virt-install -n {{ inventory_hostname }}
virt_install_command_two_nic: virt-install -n {{ inventory_hostname }}
--memory={{ mem_size }},maxmemory={{ max_mem_size }} --memballoon virtio
--disk bus=virtio,path={{ volgroup }}/{{ inventory_hostname }}
--vcpus={{ num_cpus }},maxvcpus={{ max_cpu }} -l {{ ks_repo }} -x
@ -75,10 +75,10 @@ virt_install_command_two_nic: virt-install -n {{ inventory_hostname }}
virt_install_command_rhel6: virt-install -n {{ inventory_hostname }}
--memory={{ mem_size }},maxmemory={{ max_mem_size }}
--disk bus=virtio,path={{ volgroup }}/{{ inventory_hostname }}
--vcpus={{ num_cpus }},maxvcpus={{ max_cpu }} -l {{ ks_repo }} -x
"ksdevice=eth0 ks={{ ks_url }} ip={{ eth0_ip }} netmask={{ nm }}
--vcpus={{ num_cpus }},maxvcpus={{ max_cpu }} -l {{ ks_repo }} -x
"ksdevice=eth0 ks={{ ks_url }} ip={{ eth0_ip }} netmask={{ nm }}
gateway={{ gw }} dns={{ dns }} console=tty0 console=ttyS0
hostname={{ inventory_hostname }}"
hostname={{ inventory_hostname }}"
--network=bridge=br0 --autostart --noautoconsole --watchdog default
max_mem_size: "{{ mem_size * 5 }}"
@ -132,19 +132,19 @@ nrpe_procs_crit: 300
nrpe_check_postfix_queue_warn: 2
nrpe_check_postfix_queue_crit: 5
# env is staging or production, we default it to production here.
# env is staging or production, we default it to production here.
env: production
env_suffix:
# nfs mount options, override at the group/host level
nfs_mount_opts: "ro,hard,bg,intr,noatime,nodev,nosuid,nfsvers=4"
# by default set become to false here We can override it as needed.
# Note that if become is true, you need to unset requiretty for
# ssh controlpersist to work.
# by default set become to false here We can override it as needed.
# Note that if become is true, you need to unset requiretty for
# ssh controlpersist to work.
become: false
# default the root_auth_users to nothing.
# default the root_auth_users to nothing.
# This should be set for cloud instances in their host or group vars.
root_auth_users: ''
@ -160,3 +160,8 @@ csi_relationship: |
* What hosts/services rely on this?
To update this text, add the csi_* vars to group_vars/ in ansible.
# docker images required by OpenShift Origin
openshift_required_images:
- "openshift/origin-pod"

View file

@ -191,6 +191,32 @@
when: env == "production"
}
tasks:
- name: register origin_version
shell: "rpm -q origin --qf '%{Version}'"
register: origin_version
- name: pre-stage content in our docker registry
hosts: compose-x86-01.phx2.fedoraproject.org
user: root
gather_facts: True
tags:
- releng-compose
tasks:
- name: pull openshift required docker images
shell: "docker pull {{item}}:v{{origin_version.stdout}}"
with_items: {{openshift_required_images}}
- name: tag openshift required docker images for our registry
shell: "docker tag {{item}}:v{{origin_version.stdout}} {{docker_registry}}/{{item}}:v{{origin_version.stdout}}"
with_items: {{openshift_required_images}}
- name: push openshift required docker images to our registry
shell: "docker push {{docker_registry}}/{{item}}:v{{origin_version.stdout}}"
with_items: {{openshift_required_images}}
- name: post-install osbs tasks
hosts: osbs:osbs-stg
vars_files:
@ -281,10 +307,13 @@
dest: /etc/osbs/buildroot/atomic-reactor.tar.gz
state: hard
- name: pull openshift required docker images and tag locally
shell: "docker pull {{docker_registry}}/{{item}}:v$(rpm -q origin --qf '%{Version}') && docker tag {{docker_registry}}/{{item}}:v$(rpm -q origin --qf '%{Version}') {{item}}:v$(rpm -q origin --qf '%{Version}')"
with_items:
- "openshift/origin-pod"
- name: pull openshift required docker images
shell: "docker pull {{docker_registry}}/{{item}}:v{{origin_version.stdout}}"
with_items: {{openshift_required_images}}
- name: tag openshift required docker images locally
shell: "docker tag {{docker_registry}}/{{item}}:v{{origin_version.stdout}} {{item}}:v{{origin_version.stdout}}"
with_items: {{openshift_required_images}}
- name: refresh fedora image streams
shell: "oc import-image fedora --all"