ansible/playbooks/groups/ipa.yml
Ryan Lerch 3c41882bb0 ansiblelint fixes - fqcn[action-core] - shell to ansible.builtin.shell
Replaces references to shell: with ansible.builtin.shell

Signed-off-by: Ryan Lerch <rlerch@redhat.com>
2025-01-15 11:29:10 +10:00

108 lines
2.8 KiB
YAML

---
- import_playbook: "/srv/web/infra/ansible/playbooks/include/virt-create.yml"
vars:
myhosts: "ipa:ipa_stg"
- name: make the box be real
hosts: ipa:ipa_stg
user: root
gather_facts: true
vars_files:
- /srv/web/infra/ansible/vars/global.yml
- "/srv/private/ansible/vars.yml"
- /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml
roles:
- base
- rkhunter
- nagios_client
- zabbix/zabbix_agent
- collectd/base
- hosts
- {role: openvpn/client,
when: env != "staging"}
- ipa/client
- rsyncd
- sudo
pre_tasks:
- import_tasks: "{{ tasks_path }}/yumrepos.yml"
tasks:
- import_tasks: "{{ tasks_path }}/motd.yml"
handlers:
- import_tasks: "{{ handlers_path }}/restart_services.yml"
- name: deploy ipa itself
hosts: ipa:ipa_stg
user: root
gather_facts: true
vars_files:
- /srv/web/infra/ansible/vars/global.yml
- "/srv/private/ansible/vars.yml"
- "{{ vars_path }}/{{ ansible_distribution }}.yml"
roles:
- ipa/server
- role: keytab/service
owner_user: apache
owner_group: apache
service: HTTP
host: "id{{env_suffix}}.fedoraproject.org"
notify:
- combine IPA http keytabs
handlers:
- import_tasks: "{{ handlers_path }}/restart_services.yml"
tasks:
- name: Combine IPA keytabs
ansible.builtin.shell: printf "%b" "read_kt /etc/httpd/conf/ipa.keytab\nread_kt /etc/krb5.HTTP_id{{env_suffix}}.fedoraproject.org.keytab\nwrite_kt /etc/krb5.HTTP_id{{env_suffix}}.fedoraproject.org.keytab.combined" | ktutil
changed_when: false
tags:
- krb5
- ipa/server
- name: Set owner and permissions on combined keytab
ansible.builtin.file: path="/etc/krb5.HTTP_id{{env_suffix}}.fedoraproject.org.keytab.combined"
owner=apache
group=apache
mode=0600
tags:
- krb5
- ipa/server
# original: /etc/httpd/conf/ipa.keytab
# - name: Make IPA HTTP use the combined keytab
# lineinfile: dest=/etc/httpd/conf.d/ipa.conf
# regexp='GssapiCredStore keytab:'
# line=' GssapiCredStore keytab:/etc/krb5.HTTP_id{{env_suffix}}.fedoraproject.org.keytab.combined'
# tags:
# - krb5
# - ipa/server
# - config
# - name: Make IPA HTTP use the id.fp.o client keytab
# lineinfile: dest=/etc/httpd/conf.d/ipa.conf
# regexp='GssapiCredStore client_keytab:'
# line=' GssapiCredStore client_keytab:/etc/krb5.HTTP_id{{env_suffix}}.fedoraproject.org.keytab'
# tags:
# - krb5
# - ipa/server
# - config
- name: do base role once more to revert any resolvconf changes
hosts: ipa:ipa_stg
user: root
gather_facts: true
vars_files:
- /srv/web/infra/ansible/vars/global.yml
- "/srv/private/ansible/vars.yml"
- "{{ vars_path }}/{{ ansible_distribution }}.yml"
roles:
- base
handlers:
- import_tasks: "{{ handlers_path }}/restart_services.yml"