summaryrefslogtreecommitdiff
path: root/obs-cn1.yml
diff options
context:
space:
mode:
Diffstat (limited to 'obs-cn1.yml')
-rw-r--r--obs-cn1.yml85
1 files changed, 85 insertions, 0 deletions
diff --git a/obs-cn1.yml b/obs-cn1.yml
new file mode 100644
index 00000000..329551f8
--- /dev/null
+++ b/obs-cn1.yml
@@ -0,0 +1,85 @@
+# Deploy staging OBS on devcloud
+---
+- name: Create staging machines with OpenStack
+ hosts: localhost
+ gather_facts: false
+ tasks:
+ - name: create OBS bastion server
+ os_server:
+ state: present
+ name: obs-bastion-cn1.linaro.cloud
+ image: Official Debian Stretch
+ key_name: Riku Linaro
+ wait: yes
+ flavor: m1.small
+ auto_floating_ip: yes
+ network: obs-net
+ meta:
+ hostname: obs-bastion-cn1.linaro.cloud
+ - name: Create obs_data volume
+ os_volume:
+ state: present
+ size: 400
+ display_name: obs_data
+ - name: Create obs_backup volume
+ os_volume:
+ state: present
+ size: 400
+ display_name: obs_backup
+ - name: Attach obs_data volume to obs server
+ os_server_volume:
+ state: present
+ volume: obs_data
+ server: obs-bastion-cn1.linaro.cloud
+ device: "{{ hostvars['obs-bastion-cn1.linaro.cloud'].obsdata_dev }}"
+ - name: Attach obs_backup volume to obs server
+ os_server_volume:
+ state: present
+ volume: obs_backup
+ server: obs-bastion-cn1.linaro.cloud
+ device: "{{ hostvars['obs-bastion-cn1.linaro.cloud'].obsbackup_dev }}"
+ - name: Deploy OBS worker
+ os_server:
+ state: present
+ name: obs-worker-cn1.linaro.cloud
+ image: Official Debian Stretch
+ key_name: Riku Linaro
+ wait: yes
+ flavor: m1.small
+ auto_floating_ip: yes
+ network: obs-net
+ meta:
+ hostname: obs-worker-cn1.linaro.cloud
+
+- name: Configure firewall and OBS container
+ hosts: obs-bastion-cn1.linaro.cloud
+ become: yes
+ roles:
+ - role: obs-bastion
+ worker_ip:
+ - 192.168.1.1/24
+ - role: systemd-container
+ container_name: obs
+ container_user: obs-admin
+ ssh_port: 2201
+
+- name: Install OBS server
+ hosts: obs-server-cn1.linaro.cloud
+ become: yes
+ vars_files:
+ - "{{secrets_dir}}/host_vars/{{inventory_hostname}}"
+ roles:
+ - role: letsencrypt
+ email: riku.voipio@linaro.org
+ - role: obs
+
+- name: Install staging worker
+ hosts: obs-worker-cn1.linaro.cloud
+ become: yes
+ roles:
+ - role: obs-worker
+ OBS_IP: 192.168.1.10
+ OBS_JOBS: 2
+ OBS_PORT: 5454
+ OBS_TMPFS: 0
+