Files
fedora-infra_ansible/roles/copr/backend/tasks/resalloc.yml

108 lines
2.4 KiB
YAML

- name: install packages needed by resalloc server
dnf:
state: present
name:
- genisoimage
- libvirt-client
- postgresql-server
- python3-psycopg2
- resalloc
- resalloc-server
- virt-install
- name: See if postgreSQL is initialized
stat: path=/var/lib/pgsql/data/PG_VERSION
register: postgres_initialized
- name: init postgresql
shell: "postgresql-setup initdb"
when: not postgres_initialized.stat.exists
- name: enable PostgreSQL service
service: state=started enabled=yes name=postgresql
- name: Create PG user
postgresql_user: name="resalloc"
become: yes
become_user: postgres
- name: Create db
postgresql_db: name="resalloc" encoding='UTF-8' owner=resalloc
become: yes
become_user: postgres
- name: resalloc, sync copr provisioning files
synchronize: src="provision/" dest="/var/lib/resallocserver/provision/"
tags:
- provision_config
- name: resalloc, sync resalloc provisioning files
synchronize: src="resalloc_provision/" dest="/var/lib/resallocserver/resalloc_provision/"
tags:
- provision_config
- name: resalloc, generate vars files
template:
src: "provision/{{ item }}"
dest: "/var/lib/resallocserver/provision/{{ item }}"
with_items:
- vars.yml
- nova_cloud_vars.yml
tags:
- provision_config
- name: resalloc, rpmbuild config
template:
src: provision/copr-rpmbuild/main.ini.j2
dest: /var/lib/resallocserver/provision/files/main.ini
tags:
- provision_config
- name: resalloc, rpkg config
template:
src: provision/rpkg.conf.j2
dest: /var/lib/resallocserver/provision/files/rpkg.conf
tags:
- provision_config
- name: resalloc, ssh directory
file:
path: /var/lib/resallocserver/.ssh
state: directory
mode: 0700
owner: resalloc
group: resalloc
- name: resalloc, copy backend ssh identity
copy:
src: "{{ private }}/files/copr/buildsys.priv"
dest: /var/lib/resallocserver/.ssh/id_rsa
owner: resalloc
group: resalloc
mode: 0600
- name: resalloc, ssh config file
copy:
src: "ssh_config"
dest: /var/lib/resallocserver/.ssh/config
owner: resalloc
group: resalloc
mode: 0600
- name: resalloc, server config
template:
src: "resalloc/{{ item }}"
dest: "/etc/resallocserver/{{ item }}"
mode: 0600
owner: resalloc
group: resalloc
with_items:
- server.yaml
- pools.yaml
- name: start/enable resalloc server
service:
name: resalloc
state: started
enabled: yes