mirror of
https://github.com/rocky-linux/infrastructure
synced 2024-12-25 12:28:29 +00:00
Add requirements and fix ipa vars
This commit is contained in:
parent
928c944bb4
commit
5f2426d840
27
ansible/playbooks/adhoc-ipadns.yml
Normal file
27
ansible/playbooks/adhoc-ipadns.yml
Normal file
@ -0,0 +1,27 @@
|
||||
---
|
||||
# This playbook is meant to be used with callable variables, like adhoc or AWX.
|
||||
# What: Creates dns zones in the idm infrastructure based on the variables
|
||||
# provided.
|
||||
|
||||
- name: Create a DNS Zone
|
||||
hosts: ipaserver
|
||||
become: false
|
||||
gather_facts: false
|
||||
vars_files:
|
||||
- vars/encpass.yml
|
||||
|
||||
tasks:
|
||||
- name: "Checking for user variables"
|
||||
assert:
|
||||
that:
|
||||
- ipaadmin_password | mandatory
|
||||
- ipa_zone | mandatory
|
||||
success_msg: "Required variables provided"
|
||||
fail_msg: "We are missing zone information or ipa admin password"
|
||||
|
||||
- name: "Creating DNS Zone"
|
||||
freeipa.ansible_freeipa.ipadnszone:
|
||||
ipaadmin_password: "{{ ipaadmin_password }}"
|
||||
name: "{{ ipa_zone }}"
|
||||
tags:
|
||||
- dns
|
@ -14,17 +14,17 @@
|
||||
assert:
|
||||
that:
|
||||
- ipaadmin_password | mandatory
|
||||
- ipaGroup | mandatory
|
||||
- ipaDescription | mandatory
|
||||
- ipaPosix | mandatory
|
||||
- ipa_group | mandatory
|
||||
- ipa_description | mandatory
|
||||
- ipa_posix | mandatory
|
||||
success_msg: "Required variables provided"
|
||||
fail_msg: "We are missing group information or ipa admin password"
|
||||
|
||||
- name: "Creating Mandatory Groups"
|
||||
freeipa.ansible_freeipa.ipagroup:
|
||||
ipaadmin_password: "{{ ipaadmin_password }}"
|
||||
name: "{{ ipaGroup }}"
|
||||
description: "{{ ipaDescription }}"
|
||||
nonposix: "{{ ipaPosix }}"
|
||||
name: "{{ ipa_group }}"
|
||||
description: "{{ ipa_description }}"
|
||||
nonposix: "{{ ipa_posix }}"
|
||||
tags:
|
||||
- groups
|
||||
|
@ -14,25 +14,25 @@
|
||||
assert:
|
||||
that:
|
||||
- ipaadmin_password | mandatory
|
||||
- ipaName | mandatory
|
||||
- ipaFirst | mandatory
|
||||
- ipaLast | mandatory
|
||||
- ipaEmail | mandatory
|
||||
- ipaPassword | mandatory
|
||||
- ipaTitle | mandatory
|
||||
- ipa_name | mandatory
|
||||
- ipa_first | mandatory
|
||||
- ipa_last | mandatory
|
||||
- ipa_email | mandatory
|
||||
- ipa_password | mandatory
|
||||
- ipa_title | mandatory
|
||||
success_msg: "Required variables provided"
|
||||
fail_msg: "We are missing user information or ipa admin password"
|
||||
|
||||
- name: "Creating User Account"
|
||||
freeipa.ansible_freeipa.ipauser:
|
||||
ipaadmin_password: "{{ ipaadmin_password }}"
|
||||
name: "{{ ipaName }}"
|
||||
first: "{{ ipaFirst }}"
|
||||
last: "{{ ipaLast }}"
|
||||
email: "{{ ipaEmail }}"
|
||||
password: "{{ ipaPassword }}"
|
||||
title: "{{ ipaTitle }}"
|
||||
loginshell: "{{ ipaLoginshell|default('/sbin/nologin', True) }}"
|
||||
name: "{{ ipa_name }}"
|
||||
first: "{{ ipa_first }}"
|
||||
last: "{{ ipa_last }}"
|
||||
email: "{{ ipa_email }}"
|
||||
password: "{{ ipa_password }}"
|
||||
title: "{{ ipa_title }}"
|
||||
loginshell: "{{ ipa_loginshell|default('/sbin/nologin', True) }}"
|
||||
update_password: on_create
|
||||
tags:
|
||||
- users
|
||||
|
@ -16,8 +16,8 @@ roles:
|
||||
- name: rockylinux.kojihub
|
||||
src: https://github.com/rocky-linux/ansible-role-kojihub
|
||||
version: main
|
||||
- name: rockylinux.mqtt
|
||||
src: https://github.com/rocky-linux/ansible-role-mqtt
|
||||
- name: rockylinux.rabbitmq
|
||||
src: https://github.com/rocky-linux/ansible-role-rabbitmq
|
||||
version: main
|
||||
|
||||
collections:
|
||||
@ -29,3 +29,4 @@ collections:
|
||||
- name: community.rabbitmq
|
||||
- name: ansible.posix
|
||||
- name: ktdreyer.koji_ansible
|
||||
- name: netbox.netbox
|
||||
|
Loading…
Reference in New Issue
Block a user