ansible playbook to set up a laminar container Ci build. moved to: https://git.sindominio.net/sindominio/ansible_laminar
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible_laminar/playbook.yml

98 lines
3.0 KiB

---
- hosts: all
vars_files:
- vars.yml
vars:
laminar_home: "/var/lib/laminar/"
become: yes
pre_tasks:
- name: Update apt cache if needed
apt: update_cache=yes cache_valid_time=3600
handlers:
- name: restart laminar
service: name=laminar state=restarted
- name: restart webhook
service: name=webhook state=restarted
- name: delete keyring
file: dest="{{ laminar_home }}/.gnupg" state=absent
- name: import openpgp keys
command: "gpg --homedir .gnupg --import keys.asc"
args:
chdir: "{{ laminar_home }}"
notify: laminar owns .gnupg
- name: laminar owns .gnupg
file:
path: "{{ laminar_home }}/.gnupg"
owner: laminar
group: laminar
recurse: yes
tasks:
- name: install laminar dependencies
# TODO: docker.io is in buster, but lib* are from stretch
apt: name={{ item }} state=latest
with_items:
- gnupg
- libsqlite3-0
- libboost-filesystem1.62.0
- zlib1g
- docker.io
- name: install laminar
apt:
# laminar is in it's way to get included in debian:
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=919181
deb: https://github.com/ohwgiles/laminar/releases/download/0.7/laminar-0.7-1-amd64.deb
- name: add laminar to docker group
user: name=laminar group=docker
notify: restart laminar
- name: copy openpgp keys
copy:
src: keys.asc
dest: "{{ laminar_home }}"
owner: laminar
group: laminar
mode: u=rwx,g=rx,o=rx
notify:
- delete keyring
- import openpgp keys
- name: configure build image job
template:
src: build_image.run
dest: "{{ laminar_home }}/cfg/jobs/build_image.run"
owner: laminar
group: laminar
mode: u=rwx,g=rwx,o=rx
- name: enable laminar
service: name=laminar state=started enabled=yes
- name: copy build_image script
copy:
src: build_image
dest: /usr/local/bin/build_image
owner: root
group: root
mode: u=rwx,g=rx,o=rx
- name: install webhook
apt: name=webhook state=latest
- name: configure webhook job
template:
src: webhook.conf
dest: /etc/webhook.conf
owner: laminar
group: laminar
mode: u=rwx,g=rwx,o=rx
notify: restart webhook
- name: enable webhook
service: name=webhook state=started enabled=yes