From 49c2cf296bc69cd77e024f1ac7367605ed0c6405 Mon Sep 17 00:00:00 2001 From: Tyler Hale Date: Sun, 21 Jan 2024 15:00:29 -0700 Subject: [PATCH] Fixing hostname/cert --- roles/base/tasks/core_cert.yml | 14 +++++++++++++- roles/base/tasks/core_hostname.yml | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/roles/base/tasks/core_cert.yml b/roles/base/tasks/core_cert.yml index 1be20c5..5704dce 100644 --- a/roles/base/tasks/core_cert.yml +++ b/roles/base/tasks/core_cert.yml @@ -17,6 +17,18 @@ when: ansible_python_version is version('3', '>=') become: false +- name: check if pip3 file exists + stat: + path: /bin/pip3 + register: pip3_status + +- name: Create a symbolic link for pip + file: + src: /usr/local/bin/pip3 + dest: /bin/pip3 + state: link + when: pip3_status.stat.exists == false + - name: Install latest python2-cryptography package: name: python2-cryptography @@ -30,7 +42,7 @@ executable: pip3 state: latest when: ansible_python_version is version('3', '>=') - become: false + become: true - name: Ensure directory exists for local self-signed TLS certs file: diff --git a/roles/base/tasks/core_hostname.yml b/roles/base/tasks/core_hostname.yml index 459a2f5..f5a7b5b 100644 --- a/roles/base/tasks/core_hostname.yml +++ b/roles/base/tasks/core_hostname.yml @@ -13,7 +13,7 @@ lineinfile: dest: /etc/hosts regexp: '^127\.0\.0\.1[ \t]+localhost' - line: '127.0.0.1 localhost {{ base_core_hostname }}' + line: '127.0.0.1 {{ base_core_hostname }} localhost' state: present - name: Ensure hostname is set in /etc/hosts