adding files
This commit is contained in:
parent
6bea9b14a7
commit
0c7024cec3
5
06-copying-files/ansible.cfg
Normal file
5
06-copying-files/ansible.cfg
Normal file
@ -0,0 +1,5 @@
|
||||
[defaults]
|
||||
inventory = inventory
|
||||
private_key_file = ~/.ssh/hetzner
|
||||
|
||||
|
11
06-copying-files/files/default_site.html
Normal file
11
06-copying-files/files/default_site.html
Normal file
@ -0,0 +1,11 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>Website test</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<p> Goodevening Caleb </p>
|
||||
|
||||
</body>
|
||||
</html>
|
15
06-copying-files/install_apache.yml
Normal file
15
06-copying-files/install_apache.yml
Normal file
@ -0,0 +1,15 @@
|
||||
---
|
||||
- hosts: all
|
||||
become: true
|
||||
tasks:
|
||||
|
||||
#### Ubuntu/Debian Section ####
|
||||
|
||||
- name: Install apache2 package with php support
|
||||
package:
|
||||
name:
|
||||
- "{{ apache_package }}"
|
||||
- "{{ php_package }}"
|
||||
state: latest
|
||||
update_cache: yes
|
||||
|
7
06-copying-files/inventory
Normal file
7
06-copying-files/inventory
Normal file
@ -0,0 +1,7 @@
|
||||
[web_servers]
|
||||
10.0.0.7
|
||||
10.0.0.8
|
||||
|
||||
[db_servers]
|
||||
10.0.0.5
|
||||
10.0.0.11
|
61
06-copying-files/site.yml
Normal file
61
06-copying-files/site.yml
Normal file
@ -0,0 +1,61 @@
|
||||
---
|
||||
- hosts: all
|
||||
become: true
|
||||
pre_tasks:
|
||||
|
||||
- name: install updates for RHEL distros
|
||||
tags: always
|
||||
package:
|
||||
update_only: yes
|
||||
update_cache: yes
|
||||
when: ansible_os_family == "RedHat"
|
||||
|
||||
- name: install updates for Debian distros
|
||||
tags: always
|
||||
package:
|
||||
upgrade: dist
|
||||
update_cache: yes
|
||||
when: ansible_os_family == "Debian"
|
||||
|
||||
- hosts: all
|
||||
become: true
|
||||
tasks:
|
||||
|
||||
- name: Install common packages
|
||||
package:
|
||||
name:
|
||||
- htop
|
||||
- neofetch
|
||||
|
||||
|
||||
|
||||
- hosts: web_servers
|
||||
become: true
|
||||
tasks:
|
||||
|
||||
- name: Install apache on web servers
|
||||
tags: apache
|
||||
package:
|
||||
name:
|
||||
- apache2
|
||||
- libapache2-mod-php
|
||||
|
||||
- name: Copy html file
|
||||
tags: website
|
||||
copy:
|
||||
src: default_site.html
|
||||
dest: /var/www/html/index.html
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
|
||||
|
||||
- hosts: db_servers
|
||||
tags: db, el
|
||||
become: true
|
||||
tasks:
|
||||
|
||||
- name: install mariadb package on db servers
|
||||
package:
|
||||
name: mariadb
|
||||
state: latest
|
Loading…
Reference in New Issue
Block a user