Compare commits
	
		
			2 Commits
		
	
	
		
			ae2d7aea98
			...
			7a1e728f2f
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 7a1e728f2f | |||
| b4f1d0f6a4 | 
@@ -1,2 +1,2 @@
 | 
			
		||||
[athelas]
 | 
			
		||||
vps ansible_host=95.217.153.90 ansible_connection=ssh ansible_user=motysten
 | 
			
		||||
vps ansible_host=95.217.153.90 ansible_connection=ssh ansible_user=root
 | 
			
		||||
 
 | 
			
		||||
@@ -4,18 +4,20 @@
 | 
			
		||||
  tasks:
 | 
			
		||||
 | 
			
		||||
  - name: Add Caddy GPG Key
 | 
			
		||||
    ansible.builtin.apt_key:
 | 
			
		||||
    ansible.builtin.get_url:
 | 
			
		||||
      url: https://dl.cloudsmith.io/public/caddy/stable/gpg.key
 | 
			
		||||
      state: present
 | 
			
		||||
      dest: /etc/apt/keyrings/caddy.asc
 | 
			
		||||
      mode: '0644'
 | 
			
		||||
      force: true
 | 
			
		||||
 | 
			
		||||
  - name: Add Caddy Repo
 | 
			
		||||
    ansible.builtin.apt_repository:
 | 
			
		||||
      repo: deb [signed-by=/usr/share/keyrings/caddy-stable-archive-keyring.gpg] https://dl.cloudsmith.io/public/caddy/stable/deb/debian any-version main
 | 
			
		||||
      repo: deb [signed-by=/etc/apt/keyrings/caddy.asc] https://dl.cloudsmith.io/public/caddy/stable/deb/debian any-version main
 | 
			
		||||
      state: present
 | 
			
		||||
 | 
			
		||||
  - name: Add Caddy Src Repo
 | 
			
		||||
    ansible.builtin.apt_repository:
 | 
			
		||||
      repo: deb-src [signed-by=/usr/share/keyrings/caddy-stable-archive-keyring.gpg] https://dl.cloudsmith.io/public/caddy/stable/deb/debian any-version main
 | 
			
		||||
      repo: deb-src [signed-by=/etc/apt/keyrings/caddy.asc] https://dl.cloudsmith.io/public/caddy/stable/deb/debian any-version main
 | 
			
		||||
      state: present
 | 
			
		||||
 | 
			
		||||
  - name: Install Caddy
 | 
			
		||||
@@ -29,10 +31,10 @@
 | 
			
		||||
      group: caddy
 | 
			
		||||
      owner: caddy
 | 
			
		||||
 | 
			
		||||
  - name: Creating webserver root folder
 | 
			
		||||
  - name: Creating webserver index.html
 | 
			
		||||
    ansible.builtin.file:
 | 
			
		||||
      path: /var/www/html/index.html
 | 
			
		||||
      state: present
 | 
			
		||||
      state: touch
 | 
			
		||||
      group: caddy
 | 
			
		||||
      owner: caddy
 | 
			
		||||
 | 
			
		||||
@@ -41,7 +43,5 @@
 | 
			
		||||
      src: ~/ansible/templates/Caddyfile.j2
 | 
			
		||||
      dest: /etc/caddy/Caddyfile
 | 
			
		||||
 | 
			
		||||
  - name: Reload Caddy service
 | 
			
		||||
    ansible.builtin.service:
 | 
			
		||||
      name: caddy
 | 
			
		||||
      state: reloaded
 | 
			
		||||
  - name: Reboot
 | 
			
		||||
    ansible.builtin.reboot:
 | 
			
		||||
 
 | 
			
		||||
@@ -10,13 +10,15 @@
 | 
			
		||||
        - curl
 | 
			
		||||
 | 
			
		||||
  - name: Add Docker GPG Key
 | 
			
		||||
    ansible.builtin.apt_key:
 | 
			
		||||
    ansible.builtin.get_url:
 | 
			
		||||
      url: https://download.docker.com/linux/debian/gpg
 | 
			
		||||
      state: present
 | 
			
		||||
      dest: /etc/apt/keyrings/docker.asc
 | 
			
		||||
      mode: '0644'
 | 
			
		||||
      force: true
 | 
			
		||||
 | 
			
		||||
  - name: Add Docker repo
 | 
			
		||||
    ansible.builtin.apt_repository:
 | 
			
		||||
      repo: deb https://download.docker.com/linux/debian bookworm stable
 | 
			
		||||
      repo: deb [signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian bookworm stable
 | 
			
		||||
      state: present
 | 
			
		||||
 | 
			
		||||
  - name: Install Docker
 | 
			
		||||
 
 | 
			
		||||
@@ -26,7 +26,7 @@
 | 
			
		||||
 | 
			
		||||
  - name: Create new user
 | 
			
		||||
    ansible.builtin.user:
 | 
			
		||||
      name: "test"
 | 
			
		||||
      name: "motysten"
 | 
			
		||||
      groups: "sudo"
 | 
			
		||||
      append: true
 | 
			
		||||
      password: "{{ lookup('password', '/tmp/userpass length=12 encrypt=sha512_crypt') }}"
 | 
			
		||||
@@ -38,7 +38,7 @@
 | 
			
		||||
 | 
			
		||||
  - name: Add SSH public key to remote host
 | 
			
		||||
    ansible.builtin.authorized_key:
 | 
			
		||||
      user: "test"
 | 
			
		||||
      user: "motysten"
 | 
			
		||||
      key: "{{ lookup('file', '~/ansible/keys/ssh_key.pub') }}"
 | 
			
		||||
    become: true
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -8,7 +8,7 @@
 | 
			
		||||
# this machine's public IP, then replace ":80" below with your
 | 
			
		||||
# domain name.
 | 
			
		||||
 | 
			
		||||
athelas.motysten.fr {
 | 
			
		||||
poc.athelas.fr {
 | 
			
		||||
	# Set this path to your site's directory.
 | 
			
		||||
	root * /var/www/html
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user