2021-09-01 17:31:49 -06:00
|
|
|
---
|
|
|
|
# file: roles/base/tasks/core.yml
|
|
|
|
|
|
|
|
- name: "*** Hostname Configuration ***"
|
|
|
|
include_tasks:
|
|
|
|
file: core_hostname.yml
|
|
|
|
apply:
|
|
|
|
tags: hostname
|
|
|
|
tags:
|
|
|
|
- hostname
|
|
|
|
|
2022-08-22 13:15:23 -06:00
|
|
|
# Gather facts now because the hostname may have changed
|
2021-09-01 17:31:49 -06:00
|
|
|
- name: Gather facts
|
|
|
|
setup:
|
|
|
|
when: hostname_change.changed
|
|
|
|
|
|
|
|
- name: Gather service facts
|
|
|
|
service_facts:
|
|
|
|
tags:
|
|
|
|
- always
|
|
|
|
|
2022-08-22 13:14:54 -06:00
|
|
|
- name: Attach RHEL subscription
|
2022-07-08 05:47:50 -06:00
|
|
|
redhat_subscription:
|
|
|
|
state: present
|
|
|
|
activationkey: "{{ base_redhat_subscription_activationkey }}"
|
|
|
|
org_id: "{{ base_redhat_subscription_org_id }}"
|
|
|
|
pool: '^(Red Hat Enterprise Server|Red Hat Virtualization)$'
|
2022-08-22 13:14:54 -06:00
|
|
|
when: ansible_distribution == 'RedHat' and (base_redhat_subscription_org_id != "" and base_redhat_subscription_activationkey != "")
|
2022-07-09 11:32:31 -06:00
|
|
|
|
2021-09-01 17:31:49 -06:00
|
|
|
- name: "*** MOTD Configuration ***"
|
|
|
|
include_tasks:
|
|
|
|
file: core_motd.yml
|
|
|
|
apply:
|
|
|
|
tags: motd
|
|
|
|
tags:
|
|
|
|
- motd
|
|
|
|
|
|
|
|
- name: "*** SSH Configuration ***"
|
|
|
|
include_tasks:
|
|
|
|
file: core_ssh.yml
|
|
|
|
apply:
|
|
|
|
tags: ssh
|
|
|
|
tags:
|
|
|
|
- ssh
|
|
|
|
|
2021-09-09 15:18:11 -06:00
|
|
|
- name: "*** SUDO Configuration ***"
|
|
|
|
include_tasks:
|
|
|
|
file: core_sudo.yml
|
|
|
|
apply:
|
|
|
|
tags: sudo
|
|
|
|
tags:
|
|
|
|
- sudo
|
|
|
|
|
2021-09-01 17:31:49 -06:00
|
|
|
- name: "*** Generate Self-Signed Cert ***"
|
|
|
|
include_tasks:
|
|
|
|
file: core_cert.yml
|
|
|
|
apply:
|
|
|
|
tags: cert
|
|
|
|
when: base_core_cert_common_name != ''
|
|
|
|
tags:
|
|
|
|
- cert
|
|
|
|
|
|
|
|
- name: "*** Root CA Install ***"
|
|
|
|
include_tasks:
|
|
|
|
file: core_root_ca.yml
|
|
|
|
apply:
|
|
|
|
tags: root_ca
|
|
|
|
tags:
|
|
|
|
- root_ca
|
|
|
|
|
|
|
|
- name: "*** Web Management Configuration ***"
|
|
|
|
include_tasks:
|
|
|
|
file: core_web_management.yml
|
|
|
|
apply:
|
|
|
|
tags: web_management
|
|
|
|
when: base_core_web_management == true
|
|
|
|
tags:
|
|
|
|
- web_management
|
2022-07-09 11:41:46 -06:00
|
|
|
|
2022-08-22 13:15:23 -06:00
|
|
|
- name: Disable password for management account
|
2022-07-09 11:41:46 -06:00
|
|
|
user:
|
|
|
|
name: "{{ base_core_management_user }}"
|
|
|
|
password_lock: yes
|
|
|
|
when: base_core_management_user_disable_password == true
|