aboutsummaryrefslogtreecommitdiff
path: root/provision.yaml
blob: 636e6d11b01a0b75fa910a2f42bb8fce8e568ac0 (plain) (blame)
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
---
- hosts: all
  gather_facts: no
  pre_tasks:
    - name: Install Python 2 for Ansible fact gathering
      raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal)

- hosts: all
  tasks:
    - name: Update Ubuntu server
      apt:
        update_cache: yes
        upgrade: dist
    - name: Install apt packages
      apt:
        name: [ 'docker-compose', 'borgbackup' ]
        state: latest
    - name: Create /home/vps/ base directory
      file:
        path: /home/vps/
        state: directory
    - name: Copy file
      copy: src={{ item.src }} dest={{ item.dest }}
      with_items:
        - { src: './scripts/box/bash-profile.sh', dest: '/etc/profile.d/bash-profile.sh' }
        - { src: './docker-compose.yaml', dest: '/home/vps/docker-compose.yaml' }
    - name: Start docker-compose
      docker_service:
        project_src: /home/vps/
        pull: yes
        state: present