Add configuration script for IPA
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
This commit is contained in:
parent
39c59360d8
commit
8f77ba7c00
2 changed files with 43 additions and 10 deletions
30
roles/ipa/files/configure-ipa.sh
Normal file
30
roles/ipa/files/configure-ipa.sh
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
#!/bin/bash
|
||||||
|
ADMIN_PASSWORD="$1"
|
||||||
|
DM_PASSWORD="$2"
|
||||||
|
|
||||||
|
function cleanup {
|
||||||
|
kdestroy -A
|
||||||
|
}
|
||||||
|
trap cleanup EXIT
|
||||||
|
|
||||||
|
echo $ADMIN_PASSWORD | kinit admin
|
||||||
|
|
||||||
|
# Disallow all users to change their own settings
|
||||||
|
ipa selfservice-find | grep "Self-service name:" | sed -e "s/ Self-service name: //" | \
|
||||||
|
while read line
|
||||||
|
do
|
||||||
|
echo "Removing $line"
|
||||||
|
ipa selfservice-del "$line"
|
||||||
|
done
|
||||||
|
|
||||||
|
# Create fas_sync user
|
||||||
|
ipa user-add fas_sync --first=FAS --last=Sync
|
||||||
|
|
||||||
|
# Allow sync user to update passwords
|
||||||
|
ldapmodify -x -D "cn=Directory Manager" -w "$DM_PASSWORD" -h localhost -p 389 <<EOF
|
||||||
|
dn: cn=ipa_pwd_extop,cn=plugins,cn=config
|
||||||
|
changetype: modify
|
||||||
|
add: passSyncManagersDNs
|
||||||
|
passSyncManagersDNs: uid=fas_sync,cn=users,cn=accounts,dc=fedoraproject,dc=org
|
||||||
|
EOF
|
||||||
|
exit 0
|
|
@ -119,14 +119,17 @@
|
||||||
- config
|
- config
|
||||||
when: not inventory_hostname.startswith("ipa01") and not replication_status.stat.exists
|
when: not inventory_hostname.startswith("ipa01") and not replication_status.stat.exists
|
||||||
|
|
||||||
#
|
- name: Deploy configuration script
|
||||||
# switch this to use the systemd module as soon as ansible 2.2 is out.
|
copy: src=configure-ipa.sh dest=/root/configure-ipa.sh mode=0700 owner=root group=root
|
||||||
#
|
register: config_deployed
|
||||||
|
tags:
|
||||||
|
- ipa
|
||||||
|
- config
|
||||||
|
when: inventory_hostname.startswith("ipa01")
|
||||||
|
|
||||||
#- name: mask kadmin
|
- name: Run configuration script
|
||||||
# file: src=/dev/null
|
command: /bin/bash /root/configure-ipa.sh {{ipa_dm_password}} {{ipa_admin_password}}
|
||||||
# dest=/etc/systemd/system/kadmin.service
|
tags:
|
||||||
# owner=root group=root state=link
|
- ipa
|
||||||
# tags:
|
- config
|
||||||
# - ipa
|
when: inventory.hostname.startswith("ipa01") and config_deployed.changed
|
||||||
# - config
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue