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.
 
 
 
 
 

98 lines
2.7 KiB

---
- name: apt-get install git, virtualenv, python-pip and python-setuptools
apt:
name: [ git, virtualenv, python-pip, python-setuptools ]
state: present
- name: pip install docker and docker-compose
pip:
name: [ docker, docker-compose ]
- name: apt-get install git
apt:
name:
- git
state: present
# - name: add buster repo and update cache
# apt_repository:
# repo: deb http://deb.debian.org/debian/ buster main
# state: present
# # workaround https://github.com/eliben/pycparser/issues/251
# - name: apt-get install python3-pycparser
# apt:
# name: python3-pycparser
# state: present
# - name: apt-get install python3-pip python3-dev python3-wheel python-setuptools libffi-dev libssl-dev gcc python-dev make
# apt:
# name: [python3-pip, python3-dev, python3-wheel, python-setuptools, libssl-dev, libffi-dev, gcc, python-dev, make]
# state: present
- name: get the api-host public key
command: cat /etc/ssh/ssh_host_rsa_key.pub
register: ssh_host_rsa_key_pub
changed_when: False
- name: Set up API ssh key to BIND authorized keys
authorized_key:
user: "{{ ansible_user }}"
state: present
key: "{{ ssh_host_rsa_key_pub.stdout }}"
delegate_to: bind-host
- name: mkdir /root/.enough
file:
path: "/root/.enough"
state: directory
- name: mkdir /root/.enough/{{ domain }}
file:
path: "/root/.enough/{{ domain }}"
state: directory
- name: cp /etc/ssh/ssh_host_rsa_key ~/.enough/{{ domain }}/id_rsa
copy:
remote_src: yes
src: /etc/ssh/ssh_host_rsa_key
dest: "/root/.enough/{{ domain }}/id_rsa"
owner: "{{ ansible_user }}"
mode: 0444
- name: get enough installation script
uri:
dest: /usr/local/bin/enough-build-docker-image.sh
url: https://packages.{{ domain }}/docker-enough/enough-build-docker-image.sh
- name: apt-get install curl
apt:
name:
- curl
state: present
- name: install enough
shell: |
set -e
bash -x /usr/local/bin/enough-build-docker-image.sh
docker run --rm enough install --no-version internal/data/install.sh > /usr/local/bin/enough
test -s /usr/local/bin/enough
chmod +x /usr/local/bin/enough
- name: enough manage migrate
shell: enough --domain {{ domain }} manage migrate
register: result
changed_when: '"Applying " in result.stdout'
- name: enough manage enough_api
shell: |
enough --domain {{ domain }} manage enough_api {{ domain }} root '{{ gitlab_password }}'
register: result
changed_when: '"Changed" in result.stdout'
- name: enough create service
shell: |
docker run --rm \
-v /root/.enough:/root/.enough \
-v /var/run/docker.sock:/var/run/docker.sock \
enough --domain {{ domain }} create service