Skip to content

Commit

Permalink
add nginx roles
Browse files Browse the repository at this point in the history
  • Loading branch information
hitchhooker committed Oct 25, 2023
1 parent ddebf14 commit ec51a56
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
23 changes: 17 additions & 6 deletions roles/setup_install_nginx/tasks/dotters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,44 @@
dest: '/root/.ssh/dotters_key'
mode: '0600'

- name: Add SSH key to agent
# Add SSH key to agent without password
- name: Add SSH key to agent without password
ansible.builtin.shell: |
set -o pipefail
eval $(ssh-agent -s)
ssh-add /root/.ssh/dotters_key
environment:
SSH_AUTH_SOCK: /tmp/ssh-agent.sock
when: default_dotters_private_key_pw is not defined

- name: Add SSH key to agent
# Add SSH key to agent with password
- name: Add SSH key to agent with password
ansible.builtin.shell: |
set -o pipefail
eval $(ssh-agent -s)
echo "{{ default_dotters_private_key_pw }}" | sshpass ssh-add /root/.ssh/dotters_key
environment:
SSH_AUTH_SOCK: /tmp/ssh-agent.sock
no_log: true # Do not log sensitive information
no_log: true
when: default_dotters_private_key_pw is defined

- name: Install/Update dotters.network SSL
become: True
become: true
block:
- name: Git update
ansible.builtin.git:
repo: '[email protected]:GATOTECH-LTD/dotters-ssl.git'
dest: '/opt/github/dotters-ssl'
key_file: '/root/.ssh/dotters_key'
update: yes
force: yes
tags:
- skip_ansible_lint

- name: "Check new expiration date"
ansible.builtin.shell: "openssl x509 -enddate -noout -in /opt/github/dotters-ssl/cert/cert.pem | cut -f2 -d'='"
- name: Check new expiration date
ansible.builtin.shell: |
set -o pipefail
openssl x509 -enddate -noout -in /opt/github/dotters-ssl/cert/cert.pem | cut -f2 -d'='
register: expiration_date_new_dotters

# Ensure destination directories exist
Expand Down
7 changes: 6 additions & 1 deletion roles/setup_install_nginx/tasks/ibp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,14 @@
dest: '/opt/github/ibp-ssl'
key_file: '/root/.ssh/ibp_key'
update: yes
force: yes
tags:
- skip_ansible_lint

- name: "Check new expiration date"
ansible.builtin.shell: "openssl x509 -enddate -noout -in /opt/github/ibp-ssl/cert/cert.pem | cut -f2 -d'='"
ansible.builtin.shell: |
set -o pipefail
openssl x509 -enddate -noout -in /opt/github/dotters-ssl/cert/cert.pem | cut -f2 -d'='
register: expiration_date_new_ibp

# Ensure destination directories exist
Expand Down

0 comments on commit ec51a56

Please sign in to comment.