-
Notifications
You must be signed in to change notification settings - Fork 3
81 lines (68 loc) · 4.38 KB
/
check-ubuntu-host.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Ansible check
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: install prerequisites
run: |
sudo apt update
sudo apt install --yes --reinstall software-properties-common sudo
- name: install ansible
run: |
sudo apt-add-repository --yes --update ppa:ansible/ansible
sudo apt-get install -y ansible python3 python3-setuptools
ansible-galaxy install --roles-path ./galaxy -r requirements.yml
- name: add application user
run: |
sudo adduser metacpan
- name: playbooks/deploy_users.yml
run: |
ansible-playbook -i inventories/ansible_test playbooks/deploy_users.yml --syntax-check
ansible-playbook -vvvv -i inventories/ansible_test tests/users.yml
idempotence=$(mktemp)
sudo ansible-playbook -i inventories/ansible_test tests/users.yml | tee -a ${idempotence}
tail ${idempotence} | grep -q 'changed=1.*failed=0' && (echo 'Idempotence test: pass' && exit 0) || (echo 'Idempotence test: fail' && exit 1)
- name: playbooks/deploy_packages.yml
run: |
ansible-playbook -i inventories/ansible_test playbooks/deploy_packages.yml --syntax-check
ansible-playbook -vvvv -i inventories/ansible_test tests/deploy_packages.yml
idempotence=$(mktemp)
sudo ansible-playbook -i inventories/ansible_test tests/deploy_packages.yml | tee -a ${idempotence}
tail ${idempotence} | grep -q 'changed=0.*failed=0' && (echo 'Idempotence test: pass' && exit 0) || (echo 'Idempotence test: fail' && exit 1)
- name: playbooks/deploy_docker_mgmt.yml
run: |
ansible-playbook -i inventories/ansible_test playbooks/deploy_docker_mgmt.yml --syntax-check
ansible-playbook -vvvv -i inventories/ansible_test tests/deploy_docker_mgmt.yml
idempotence=$(mktemp)
sudo ansible-playbook -i inventories/ansible_test tests/deploy_docker_mgmt.yml | tee -a ${idempotence}
tail ${idempotence} | grep -q 'changed=2.*failed=0' && (echo 'Idempotence test: pass' && exit 0) || (echo 'Idempotence test: fail' && exit 1)
- name: playbooks/deploy_github-meets-cpan.yml
run: |
ansible-playbook -i inventories/ansible_test tests/deploy_github-meets-cpan.yml --syntax-check
ansible-playbook -vvvv -i inventories/ansible_test tests/deploy_github-meets-cpan.yml
idempotence=$(mktemp)
sudo ansible-playbook -i inventories/ansible_test tests/deploy_github-meets-cpan.yml | tee -a ${idempotence}
tail ${idempotence} | grep -q 'changed=1.*failed=0' && (echo 'Idempotence test: pass' && exit 0) || (echo 'Idempotence test: fail' && exit 1)
- name: playbooks/deploy_grep_metacpan.yml
run: |
ansible-playbook -i inventories/ansible_test tests/deploy_grep_metacpan.yml --syntax-check
ansible-playbook -vvvv -i inventories/ansible_test tests/deploy_grep_metacpan.yml
idempotence=$(mktemp)
sudo ansible-playbook -i inventories/ansible_test tests/deploy_grep_metacpan.yml | tee -a ${idempotence}
tail ${idempotence} | grep -q 'changed=1.*failed=0' && (echo 'Idempotence test: pass' && exit 0) || (echo 'Idempotence test: fail' && exit 1)
- name: playbooks/deploy_hound_metacpan.yml
run: |
ansible-playbook -i inventories/ansible_test tests/deploy_hound_metacpan.yml --syntax-check
ansible-playbook -vvvv -i inventories/ansible_test tests/deploy_hound_metacpan.yml
idempotence=$(mktemp)
sudo ansible-playbook -i inventories/ansible_test tests/deploy_hound_metacpan.yml | tee -a ${idempotence}
tail ${idempotence} | grep -q 'changed=1.*failed=0' && (echo 'Idempotence test: pass' && exit 0) || (echo 'Idempotence test: fail' && exit 1)
- name: playbooks/deploy_web_metacpan.yml
run: |
ansible-playbook -i inventories/ansible_test tests/deploy_web_metacpan.yml --syntax-check
ansible-playbook -vvvv -i inventories/ansible_test tests/deploy_web_metacpan.yml
idempotence=$(mktemp)
sudo ansible-playbook -i inventories/ansible_test tests/deploy_web_metacpan.yml | tee -a ${idempotence}
tail ${idempotence} | grep -q 'changed=0.*failed=0' && (echo 'Idempotence test: pass' && exit 0) || (echo 'Idempotence test: fail' && exit 1)