Added new index.html to install_nginx.yml
This commit is contained in:
parent
7fd3bb2c37
commit
4bb1d838dd
@ -1,4 +1,4 @@
|
|||||||
- hosts: nginx
|
- hosts: webserver
|
||||||
become: true
|
become: true
|
||||||
tasks:
|
tasks:
|
||||||
- name: Install nginx
|
- name: Install nginx
|
||||||
@ -7,6 +7,11 @@
|
|||||||
state: present
|
state: present
|
||||||
update_cache: yes
|
update_cache: yes
|
||||||
notify: restart nginx
|
notify: restart nginx
|
||||||
|
- name: Copy over index.html
|
||||||
|
ansible.builtin.template:
|
||||||
|
src: ./templates/index.html.j2
|
||||||
|
dest: /var/www/html/index.html
|
||||||
|
become: true
|
||||||
|
|
||||||
handlers:
|
handlers:
|
||||||
- name: restart nginx
|
- name: restart nginx
|
||||||
|
17
playbooks/templates/index.html.j2
Normal file
17
playbooks/templates/index.html.j2
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8" />
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
<title>Hello</title>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<p>Hostname: {{ ansible_facts.nodename }}</p>
|
||||||
|
<p>OS: {{ ansible_facts.distribution }} {{ ansible_facts.distribution_version }}</p>
|
||||||
|
<p>Kernel: {{ ansible_facts.kernel }}</p>
|
||||||
|
<p>Memory usage: {{ ansible_facts.memfree_mb }}/{{ ansible_facts.memtotal_mb }}MB</p>
|
||||||
|
<p>Python version: {{ ansible_facts.python_version }}</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
x
Reference in New Issue
Block a user