-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.yml
More file actions
70 lines (65 loc) · 1.8 KB
/
deploy.yml
File metadata and controls
70 lines (65 loc) · 1.8 KB
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
---
- hosts: source
tasks:
- name: pull git repo
git:
repo: 'https://github.com/sunil4356/sample.git'
dest: /home/oche/challange/
update: yes
version: master
- name: install java
apt: name=openjdk-11-jdk update_cache=yes
- name: ensure the jenkins apt repository key is installed
apt_key: url=https://pkg.jenkins.io/debian-stable/jenkins.io.key state=present
become: yes
- name: ensure the repository is configured
apt_repository: repo='deb https://pkg.jenkins.io/debian-stable binary/' state=present
become: yes
- name: ensure jenkins is installed
apt: name=jenkins update_cache=yes
become: yes
- name: ensure jenkins is running
service: name=jenkins state=started
- hosts: client
tasks:
- name: Install Nginx
apt:
name: nginx
state: present
- name: Install git
apt:
name: git
state: present
- name: start nginx
service:
name: nginx
state: started
enabled: yes
- name: Copy index.html file to client server
copy:
#remote_src: True
src: /home/oche/challange/index.html
dest: /var/www/html/
- name: Install Postgres SQL
apt: name={{ item }} update_cache=true state=present
with_items:
- postgresql
- postgresql-contrib
- libpq-dev
- python3-psycopg2
- name: Ensure the PostgreSQL service is running
service:
name: postgresql
state: started
enabled: yes
- hosts: all
tasks:
- name: Ensure that free space on the tested volume is greater than 15%
assert:
that:
- mount.size_available > mount.size_total|float * 0.15
msg: Disk space has reached 85% threshold
vars:
mount: "{{ ansible_mounts | selectattr('mount','equalto',item.mount) | list | first }}"
with_items:
- "{{ ansible_mounts }}"