Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support IPA IPA Trust with additional IPA server #106

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions data/configs/dnsmasq.conf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ cache-size=0

# These zones have their own DNS server
server=/ipa.test/172.16.100.10
server=/ipa2.test/172.16.100.11
server=/samba.test/172.16.100.30
server=/ad.test/172.16.200.10

Expand All @@ -35,3 +36,4 @@ ptr-record=30.100.16.172.in-addr.arpa,dc.samba.test
ptr-record=40.100.16.172.in-addr.arpa,client.test
ptr-record=10.200.16.172.in-addr.arpa,dc.ad.test
ptr-record=70.100.16.172.in-addr.arpa,master.keycloak.test
ptr-record=80.100.16.172.in-addr.arpa,master2.ipa2.test
22 changes: 22 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,28 @@ services:
networks:
sssd:
ipv4_address: 172.16.100.10
ipa2:
image: ${REGISTRY}/ci-ipa2:${TAG}
container_name: ipa2
hostname: master2.ipa2.test
dns: 172.16.100.2
env_file: ./env.containers
volumes:
- ./shared:/shared:rw
cap_add:
- SYS_ADMIN
- SYS_PTRACE
- AUDIT_WRITE
- AUDIT_CONTROL
- SYS_CHROOT
- NET_ADMIN
security_opt:
- apparmor=unconfined
- label=disable
- seccomp=unconfined
networks:
sssd:
ipv4_address: 172.16.100.11
ldap:
image: ${REGISTRY}/ci-ldap:${TAG}
container_name: ldap
Expand Down
7 changes: 7 additions & 0 deletions src/ansible/group_vars/all
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ service: {
netbios: 'IPA',
password: 'Secret123'
},
ipa2: {
domain: 'ipa2.test',
hostname: 'master2',
fqn: 'master2.ipa2.test',
netbios: 'IPA2',
password: 'Secret123'
},
ldap: {
domain: 'ldap.test',
hostname: 'master',
Expand Down
2 changes: 2 additions & 0 deletions src/ansible/inventory.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ all:
hosts:
master.ipa.test:
ansible_host: sssd-wip-ipa
master2.ipa2.test:
ansible_host: sssd-wip-ipa2
ldap:
hosts:
master.ldap.test:
Expand Down
4 changes: 2 additions & 2 deletions src/ansible/roles/cleanup/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

- name: Remove 389ds database to make image smaller
shell: rm -f /var/lib/dirsrv/slapd-IPA-TEST/db/__db.*
when: inventory_hostname == 'master.ipa.test' or inventory_hostname == 'ipa-devel'
when: inventory_hostname in groups["ipa"] or inventory_hostname == 'ipa-devel'

- name: Minimize LDAP service container
block:
Expand All @@ -29,4 +29,4 @@

- name: Remove SSSD's database and logs
shell: rm -f /var/lib/sss/db/* /var/lib/sss/mc/* /var/log/sssd/*
when: inventory_hostname == 'client.test' or inventory_hostname == 'master.ipa.test'
when: inventory_hostname in groups["client"] or inventory_hostname in groups["ipa"]
10 changes: 6 additions & 4 deletions src/ansible/roles/dns/templates/etc.dnsmasq.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ domain=test
cache-size=0

# These zones have their own DNS server
{% if 'master.ipa.test' in hostvars %}
server=/ipa.test/{{ hostvars['master.ipa.test']['ansible_facts']['default_ipv4']['address'] }}
{% endif %}
{% for host in groups['ipa'] %}
server=/{{ hostvars[host]['ansible_facts']['domain'] }}/{{ hostvars[host]['ansible_facts']['default_ipv4']['address'] }}
{% endfor %}
{% if 'dc.samba.test' in hostvars %}
server=/samba.test/{{ hostvars['dc.samba.test']['ansible_facts']['default_ipv4']['address'] }}
{% endif %}
Expand All @@ -28,7 +28,9 @@ server=/{{ hostvars[ad]['ansible_facts']['windows_domain'] }}/{{ hostvars[ad]['a
{% endif %}

# Add reverse zones for artificial hosts in IPA domain
{% if 'master.ipa.test' in hostvars %}
server=/251.255.10.in-addr.arpa/{{ hostvars['master.ipa.test']['ansible_facts']['default_ipv4']['address'] }}
{% endif %}

# Add SRV record for LDAP
{% if 'master.ldap.test' in hostvars %}
Expand All @@ -51,4 +53,4 @@ ptr-record={{ hostvars[host]['ansible_facts']['default_ipv4']['address'].split('
{% elif hostvars[host].ansible_system == 'Win32NT' %}
ptr-record={{ hostvars[host]['ansible_facts']['ip_addresses'][0].split('.') | reverse | join(".") }}.in-addr.arpa,{{ host }}
{% endif %}
{% endfor %}
{% endfor %}
5 changes: 5 additions & 0 deletions src/ansible/roles/ipa/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
ipa --no-prompt dnszone-add --name-from-ip 10.255.251.0/24
args:
stdin: '{{ ipa_password }}'
when: inventory_hostname == 'master.ipa.test'

- name: 'Check trust with other domains'
shell: |
Expand Down Expand Up @@ -144,6 +145,7 @@
- '"samba" in groups and groups["samba"]'
- join_samba
- trust_ipa_samba
- inventory_hostname != 'master2.ipa2.test'

- name: 'Setup trust with AD'
block:
Expand All @@ -167,6 +169,8 @@
when:
- 'ad_domain not in trust.stdout'
- not trust_ipa_ad_two_way
- inventory_hostname != 'master2.ipa2.test'

- name: Run ipa trust-add (two-way)
shell: |
kinit admin
Expand All @@ -182,3 +186,4 @@
- '"ad" in groups and groups["ad"]'
- join_ad
- trust_ipa_ad
- inventory_hostname != 'master2.ipa2.test'
1 change: 1 addition & 0 deletions src/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ ansible-playbook $ANSIBLE_OPTS ./ansible/playbook_image_service.yml
compose stop
build_service_image sssd-wip-client client
build_service_image sssd-wip-ipa ipa
build_service_image sssd-wip-ipa2 ipa2
build_service_image sssd-wip-ldap ldap
build_service_image sssd-wip-samba samba
build_service_image sssd-wip-nfs nfs
Expand Down
3 changes: 3 additions & 0 deletions src/docker-compose.build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ services:
ipa:
image: localhost/sssd/ci-base-ipa:${TAG}
container_name: sssd-wip-ipa
ipa2:
image: localhost/sssd/ci-base-ipa:${TAG}
container_name: sssd-wip-ipa2
ldap:
image: localhost/sssd/ci-base-ldap:${TAG}
container_name: sssd-wip-ldap
Expand Down
1 change: 1 addition & 0 deletions src/push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ push ci-dns latest ""
push ci-client "$TAG" "$EXTRA_TAGS"
push ci-client-devel "$TAG" "$EXTRA_TAGS"
push ci-ipa "$TAG" "$EXTRA_TAGS"
push ci-ipa2 "$TAG" "$EXTRA_TAGS"
push ci-ipa-devel "$TAG" "$EXTRA_TAGS"
push ci-ldap "$TAG" "$EXTRA_TAGS"
push ci-samba "$TAG" "$EXTRA_TAGS"
Expand Down
2 changes: 1 addition & 1 deletion src/tools/gen-ssh-keys.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ mkdir -p $OUT
mkdir -p $OUT/hosts

for name in client.test dc.samba.test dns.test kdc.test \
master.ipa.test master.keycloak.test master.ldap.test nfs.test; do
master.ipa.test master2.ipa2.test master.keycloak.test master.ldap.test nfs.test; do
for type in ecdsa ed25519 rsa; do
ssh-keygen -C "Well known key for sssd-ci." -t $type -f "$OUT/hosts/$name.${type}_key" -N "" <<< y
done
Expand Down
2 changes: 2 additions & 0 deletions src/tools/setup-dns-files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ sed -i '/client.test/d' /etc/hosts
sed -i '/nfs.test/d' /etc/hosts
sed -i '/kdc.test/d' /etc/hosts
sed -i '/dc.ad.test/d' /etc/hosts
sed -i '/master2.ipa2.test/d' /etc/hosts

# Append the lines
echo "172.16.100.10 master.ipa.test" >> /etc/hosts
Expand All @@ -26,3 +27,4 @@ echo "172.16.100.40 client.test" >> /etc/hosts
echo "172.16.100.50 nfs.test" >> /etc/hosts
echo "172.16.100.60 kdc.test" >> /etc/hosts
echo "172.16.200.10 dc.ad.test" >> /etc/hosts
echo "172.16.100.11 master2.ipa2.test" >> /etc/hosts
Loading