-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapplication.playbook.yml
executable file
·33 lines (31 loc) · 1.13 KB
/
application.playbook.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env -S buildah unshare ansible-playbook
---
- name: Create Galaxy Application Container
hosts: buildah_server
gather_facts: false
vars_files: [vars.yml]
roles:
- role: new_container
vars:
name: "{{ containers.app.name }}"
base_image: python:3.10-slim
cmd: 'gunicorn -c {{ paths.config }}/gunicorn.conf.py'
#user: '{{ app.uid }}:{{ app.gid }}'
envs:
PYTHONPATH: '{{ paths.root }}/lib'
GALAXY_CONFIG_FILE: '{{ paths.config }}/galaxy.yml'
GALAXY_ROOT_DIR: '{{ paths.root }}'
- name: Configure Container Environment
hosts: "{{ containers.app.name }}"
gather_facts: true
vars_files: [vars.yml]
roles: [galaxy_env, galaxy_app, galaxy_docker, galaxy_k8s, galaxy_text_tools]
- name: Finish Galaxy Application Container
hosts: buildah_server
gather_facts: false
vars_files: [vars.yml]
tasks:
- name: Set default user
command: buildah config --user '{{ app.uid }}:{{ app.gid }}' {{ hostvars[containers.app.name]['ansible_host'] }}
- name: Commit container
command: buildah commit {{ hostvars[containers.app.name]['ansible_host'] }} {{ containers.app.name }}