mirror of
https://github.com/Expand-sys/ansibleteleportsetup
synced 2025-12-15 13:32:20 +11:00
no longer fails on gather facts for reverse proxy + restarts teleport after updating
This commit is contained in:
parent
b9313a3bf7
commit
154ca96059
3 changed files with 16 additions and 4 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
inventory2
|
||||
|
|
@ -14,6 +14,11 @@
|
|||
register: teleport_bin
|
||||
ignore_errors: true
|
||||
|
||||
- name: Ensure teleport is stopped.
|
||||
ansible.builtin.service:
|
||||
name: 'teleport'
|
||||
state: 'stopped'
|
||||
|
||||
- name: install teleport
|
||||
ansible.builtin.shell:
|
||||
cmd: 'curl https://goteleport.com/static/install.sh | bash -s {{ TELEPORT_VER }}'
|
||||
|
|
@ -21,7 +26,7 @@
|
|||
|
||||
|
||||
- name: Ensure teleport has selected state and enabled on boot.
|
||||
service:
|
||||
ansible.builtin.service:
|
||||
name: 'teleport'
|
||||
state: 'started'
|
||||
enabled: yes
|
||||
|
|
@ -82,7 +87,7 @@
|
|||
executable: /bin/bash
|
||||
|
||||
- name: Ensure teleport has selected state and enabled on boot.
|
||||
service:
|
||||
ansible.builtin.service:
|
||||
name: 'teleport'
|
||||
state: 'started'
|
||||
enabled: yes
|
||||
|
|
@ -110,6 +115,7 @@
|
|||
name: reverse proxy setup
|
||||
vars:
|
||||
become: true
|
||||
gather_facts: false
|
||||
pre_tasks:
|
||||
- name: Load variables
|
||||
ansible.builtin.include_vars: '{{ item }}'
|
||||
|
|
@ -118,4 +124,5 @@
|
|||
tasks:
|
||||
- name: set up reverse proxy
|
||||
include_tasks: reverseproxy.ansible.yml
|
||||
when: REVERSE_PROXY
|
||||
when: REVERSE_PROXY
|
||||
|
||||
|
|
@ -4,7 +4,11 @@
|
|||
url: https://caddyserver.com/api/download?os=linux&arch=amd64&p=github.com%2Fcaddy-dns%2Fcloudflare&idempotency=54951177807414
|
||||
dest: /usr/bin/caddy
|
||||
mode: '0751'
|
||||
|
||||
- name: grab ip address from gather_facts
|
||||
ansible.builtin.setup:
|
||||
gather_subset:
|
||||
- ansible_default_ipv4.address
|
||||
- ansible_fips
|
||||
- name: create caddyfile
|
||||
ansible.builtin.blockinfile:
|
||||
block: |
|
||||
|
|
|
|||
Loading…
Reference in a new issue