mirror of
https://github.com/rocky-linux/infrastructure
synced 2024-12-22 10:58:29 +00:00
commit
27e05b44fb
30
ansible/playbooks/adhoc-ipagetcert.yml
Normal file
30
ansible/playbooks/adhoc-ipagetcert.yml
Normal file
@ -0,0 +1,30 @@
|
||||
---
|
||||
# This playbook is meant to be used with callable variables, like adhoc or AWX.
|
||||
# What: Requests and signs a certificate from an IPA CA
|
||||
# What is expected:
|
||||
# -> getcert_name: Name of the certificate (FQDN)
|
||||
# -> getcert_owner: what account owns the certificate files
|
||||
# -> getcert_key: path to the certificate key
|
||||
# -> getcert_cert: path to the certificate
|
||||
# -> getcert_postcmd: command to run after a certificate renews
|
||||
# -> getcert_chain: true/false, should cert and key be chained together
|
||||
# -> getcert_chain_location: location for the chain
|
||||
# TODO: Add CNAME/SAN support
|
||||
|
||||
- name: Request and sign an IPA Certificate
|
||||
hosts: "{{ host }}"
|
||||
become: true
|
||||
gather_facts: false
|
||||
vars:
|
||||
ipa_getcert_requested_hostnames:
|
||||
- name: "{{ getcert_name|default(ansible_fqdn) }}"
|
||||
owner: "{{ getcert_owner|default(omit} }}"
|
||||
key_location: "{{ getcert_key|default(omit) }}"
|
||||
cert_location: "{{ getcert_cert|defailt(omit) }}"
|
||||
postcmd: "{{ getcert_postcmd|default(omit) }}"
|
||||
ipa_getcert_chain: "{{ getcert_chain|default(omit) }}"
|
||||
ipa_getcert_chain_location: "{{ getcert_chain_location|default(omit) }}"
|
||||
|
||||
roles:
|
||||
- role: rockylinux.ipagetcert
|
||||
state: present
|
@ -21,6 +21,12 @@
|
||||
success_msg: "We are able to run on this node"
|
||||
fail_msg: "/etc/no-ansible exists - skipping run on this node"
|
||||
|
||||
- name: Apply hostname based on inventory name
|
||||
hostname:
|
||||
name: "{{ inventory_hostname }}"
|
||||
use: systemd
|
||||
when: ansible_fqdn != inventory_hostname
|
||||
|
||||
roles:
|
||||
- role: freeipa.ansible_freeipa.ipaclient
|
||||
state: present
|
||||
|
@ -62,6 +62,12 @@
|
||||
state: present
|
||||
|
||||
post_tasks:
|
||||
- name: Start and enable httpd
|
||||
service:
|
||||
name: httpd
|
||||
state: running
|
||||
enabled: true
|
||||
|
||||
- name: Touching run file that ansible has ran here
|
||||
file:
|
||||
path: /var/log/ansible.run
|
||||
|
Loading…
Reference in New Issue
Block a user