Add requirements and fix ipa vars

This commit is contained in:
nazunalika 2020-12-27 19:27:45 -07:00
parent 928c944bb4
commit 5f2426d840
4 changed files with 49 additions and 21 deletions

View 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

View File

@ -14,17 +14,17 @@
assert: assert:
that: that:
- ipaadmin_password | mandatory - ipaadmin_password | mandatory
- ipaGroup | mandatory - ipa_group | mandatory
- ipaDescription | mandatory - ipa_description | mandatory
- ipaPosix | mandatory - ipa_posix | mandatory
success_msg: "Required variables provided" success_msg: "Required variables provided"
fail_msg: "We are missing group information or ipa admin password" fail_msg: "We are missing group information or ipa admin password"
- name: "Creating Mandatory Groups" - name: "Creating Mandatory Groups"
freeipa.ansible_freeipa.ipagroup: freeipa.ansible_freeipa.ipagroup:
ipaadmin_password: "{{ ipaadmin_password }}" ipaadmin_password: "{{ ipaadmin_password }}"
name: "{{ ipaGroup }}" name: "{{ ipa_group }}"
description: "{{ ipaDescription }}" description: "{{ ipa_description }}"
nonposix: "{{ ipaPosix }}" nonposix: "{{ ipa_posix }}"
tags: tags:
- groups - groups

View File

@ -14,25 +14,25 @@
assert: assert:
that: that:
- ipaadmin_password | mandatory - ipaadmin_password | mandatory
- ipaName | mandatory - ipa_name | mandatory
- ipaFirst | mandatory - ipa_first | mandatory
- ipaLast | mandatory - ipa_last | mandatory
- ipaEmail | mandatory - ipa_email | mandatory
- ipaPassword | mandatory - ipa_password | mandatory
- ipaTitle | mandatory - ipa_title | mandatory
success_msg: "Required variables provided" success_msg: "Required variables provided"
fail_msg: "We are missing user information or ipa admin password" fail_msg: "We are missing user information or ipa admin password"
- name: "Creating User Account" - name: "Creating User Account"
freeipa.ansible_freeipa.ipauser: freeipa.ansible_freeipa.ipauser:
ipaadmin_password: "{{ ipaadmin_password }}" ipaadmin_password: "{{ ipaadmin_password }}"
name: "{{ ipaName }}" name: "{{ ipa_name }}"
first: "{{ ipaFirst }}" first: "{{ ipa_first }}"
last: "{{ ipaLast }}" last: "{{ ipa_last }}"
email: "{{ ipaEmail }}" email: "{{ ipa_email }}"
password: "{{ ipaPassword }}" password: "{{ ipa_password }}"
title: "{{ ipaTitle }}" title: "{{ ipa_title }}"
loginshell: "{{ ipaLoginshell|default('/sbin/nologin', True) }}" loginshell: "{{ ipa_loginshell|default('/sbin/nologin', True) }}"
update_password: on_create update_password: on_create
tags: tags:
- users - users

View File

@ -16,8 +16,8 @@ roles:
- name: rockylinux.kojihub - name: rockylinux.kojihub
src: https://github.com/rocky-linux/ansible-role-kojihub src: https://github.com/rocky-linux/ansible-role-kojihub
version: main version: main
- name: rockylinux.mqtt - name: rockylinux.rabbitmq
src: https://github.com/rocky-linux/ansible-role-mqtt src: https://github.com/rocky-linux/ansible-role-rabbitmq
version: main version: main
collections: collections:
@ -29,3 +29,4 @@ collections:
- name: community.rabbitmq - name: community.rabbitmq
- name: ansible.posix - name: ansible.posix
- name: ktdreyer.koji_ansible - name: ktdreyer.koji_ansible
- name: netbox.netbox