testing purposes

This commit is contained in:
Fabio Sinibaldi 2026-07-27 17:21:41 +02:00
parent 9095522515
commit 14dcfb436d
5 changed files with 63 additions and 0 deletions

View File

@ -0,0 +1,29 @@
---
- name: Pull docker image
docker_image:
name: "nginx"
source: pull
- name: Create site dir
file:
path: "statis_nginx_site"
state: directory
register: site_dir
- name: Create index.html
template:
src: templates/index.html.j2
dest: "{{site_dir.path}}/index.html"
- name: Create container
docker_container:
name: nginx-static
image: nginx
ports:
- "80:80"
volumes:
- "{{ site_dir.path }}:/usr/share/nginx/html"
restart_policy : "unless-stopped"
init : true

View File

@ -0,0 +1,2 @@
---
- include_tasks: docker_nginx.yaml

View File

@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang=”en”>
<head>
<meta charset=”UTF-8″>
<meta name=”viewport” content=”width=device-width, initial-scale=1.0″>
<title>Welcome to My NGINX App</title>
<link rel=”stylesheet” href=”style.css”>
</head>
<body>
<h1>Static</h1>
<p>This is a static web page served by NGINX inside a Docker container.</p>
</body>
</html>

View File

@ -0,0 +1,9 @@
---
- name : Nginx static with docker
hosts: all
become: true
roles:
- geerlingguy.docker
- newt_client
- nginx

View File

@ -0,0 +1,10 @@
---
- name: tests
hosts: all
tasks:
- name: testing
shell: echo $USER
- name: testing sudo
become: true
shell: echo $USER