Skip to content
Merged
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
3 changes: 2 additions & 1 deletion roles/freeipa_client/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# Copyright 2025 Cloudera, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -12,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# ipaclient_packages: []
# freeipa_client_packages: []

ipaclient_domain: "{{ undef(hint='Please define the DNS domain') }}"
ipaclient_realm: "{{ undef(hint='Please define the Kerberos realm') }}"
Expand Down
1 change: 1 addition & 0 deletions roles/freeipa_client/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# Copyright 2025 Cloudera, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
3 changes: 2 additions & 1 deletion roles/freeipa_client/meta/argument_specs.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# Copyright 2025 Cloudera, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -23,7 +24,7 @@ argument_specs:
author: Cloudera Labs
version_added: "3.0.0"
options:
ipaclient_packages:
freeipa_client_packages:
description:
- List of FreeIPA packages to install.
- If not defined, the role will default to the packages defined in the
Expand Down
1 change: 1 addition & 0 deletions roles/freeipa_client/molecule/default/converge.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# Copyright 2024 Cloudera, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
7 changes: 4 additions & 3 deletions roles/freeipa_client/molecule/default/create.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# Copyright 2024 Cloudera, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -25,7 +26,7 @@

run_config_path: "{{ lookup('env', 'MOLECULE_EPHEMERAL_DIRECTORY') }}/run-config.yml"
run_config_from_file: "{{ (lookup('file', run_config_path, errors='ignore') or '{}') | from_yaml }}"
run_config: '{{ default_run_config | combine(run_config_from_file) }}'
run_config: "{{ default_run_config | combine(run_config_from_file) }}"

# Platform settings handling
default_assign_public_ip: true
Expand All @@ -38,7 +39,7 @@
default_public_key_path: "{{ default_private_key_path }}.pub"
default_ssh_user: ansible
default_ssh_port: 22
default_user_data: ''
default_user_data: ""

default_security_group_name: "molecule-{{ run_config.run_id }}"
default_security_group_description: Ephemeral security group for Molecule instances
Expand Down Expand Up @@ -123,7 +124,7 @@
- platform.vpc_id is string
- platform.vpc_subnet_id is string and platform.vpc_subnet_id | length > 0
quiet: true
loop: '{{ platforms }}'
loop: "{{ platforms }}"
loop_control:
loop_var: platform
label: "{{ platform.name }}"
Expand Down
5 changes: 3 additions & 2 deletions roles/freeipa_client/molecule/default/destroy.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# Copyright 2024 Cloudera, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -25,7 +26,7 @@

run_config_path: "{{ lookup('env', 'MOLECULE_EPHEMERAL_DIRECTORY') }}/run-config.yml"
run_config_from_file: "{{ (lookup('file', run_config_path, errors='ignore') or '{}') | from_yaml }}"
run_config: '{{ default_run_config | combine(run_config_from_file) }}'
run_config: "{{ default_run_config | combine(run_config_from_file) }}"

# Platform settings handling
default_aws_profile: "{{ lookup('env', 'AWS_PROFILE') }}"
Expand Down Expand Up @@ -69,7 +70,7 @@
- platform.vpc_id is string
- platform.vpc_subnet_id is string and platform.vpc_subnet_id | length > 0
quiet: true
loop: '{{ platforms }}'
loop: "{{ platforms }}"
loop_control:
loop_var: platform
label: "{{ platform.name }}"
Expand Down
1 change: 1 addition & 0 deletions roles/freeipa_client/molecule/default/molecule.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# Copyright 2024 Cloudera, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
20 changes: 11 additions & 9 deletions roles/freeipa_client/molecule/default/prepare.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# Copyright 2024 Cloudera, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -14,8 +15,8 @@

- name: Prepare server
hosts: server
gather_facts: yes
become: yes
gather_facts: true
become: true
tasks:
- name: Extract the VPC subnet ID from the Molecule platform configuration
ansible.builtin.set_fact:
Expand All @@ -25,14 +26,14 @@
amazon.aws.ec2_vpc_subnet_info:
subnet_id: "{{ test_subnet_id }}"
register: __subnet
become: no
become: false
delegate_to: localhost

- name: Retrieve the VPC details
amazon.aws.ec2_vpc_net_info:
vpc_ids: "{{ __subnet.subnets | map(attribute='vpc_id') | first }}"
register: __vpc
become: no
become: false
delegate_to: localhost

- name: Update the core networking
Expand All @@ -57,8 +58,8 @@

- name: Prepare clients
hosts: clients
gather_facts: yes
become: yes
gather_facts: true
become: true
tasks:
- name: Extract the VPC subnet ID from the Molecule platform configuration
ansible.builtin.set_fact:
Expand All @@ -68,14 +69,14 @@
amazon.aws.ec2_vpc_subnet_info:
subnet_id: "{{ test_subnet_id }}"
register: __subnet
become: no
become: false
delegate_to: localhost

- name: Retrieve the VPC details
amazon.aws.ec2_vpc_net_info:
vpc_ids: "{{ __subnet.subnets | map(attribute='vpc_id') | first }}"
register: __vpc
become: no
become: false
delegate_to: localhost

- name: Update the core networking
Expand All @@ -86,4 +87,5 @@
network_dns_domain: "{{ ipaserver_domain }}"
# See https://docs.aws.amazon.com/vpc/latest/userguide/vpc-dns.html
vpc_cidr: "{{ __vpc.vpcs | map(attribute='cidr_block') | list }}"
network_dns_forwarders: "{{ groups['server'] | map('extract', hostvars, ['ansible_default_ipv4', 'address']) | community.general.lists_union(vpc_cidr | map('ansible.utils.ipmath', '2') | list) }}"
network_dns_forwarders: "{{ groups['server'] | map('extract', hostvars, ['ansible_default_ipv4', 'address']) | community.general.lists_union(vpc_cidr | map('ansible.utils.ipmath',
'2') | list) }}"
1 change: 1 addition & 0 deletions roles/freeipa_client/molecule/default/requirements.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# Copyright 2024 Cloudera, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
1 change: 1 addition & 0 deletions roles/freeipa_client/molecule/default/verify.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# Copyright 2024 Cloudera, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
7 changes: 4 additions & 3 deletions roles/freeipa_client/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# Copyright 2024 Cloudera, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -44,11 +45,11 @@
ansible.builtin.meta: flush_handlers

- name: Install defined FreeIPA client packages
when: ipaclient_packages is defined
when: freeipa_client_packages is defined
ansible.builtin.package:
name: "{{ __ipa_package }}"
state: present
loop: "{{ ipaclient_packages }}"
loop: "{{ freeipa_client_packages }}"
loop_control:
loop_var: __ipa_package

Expand All @@ -59,6 +60,6 @@
state: present
ipaclient_hostname: "{{ inventory_hostname }}"
ipaclient_mkhomedir: true
ipaclient_install_packages: "{{ (ipaclient_packages is undefined) | ternary('true', 'false') }}"
ipaclient_install_packages: "{{ freeipa_client_packages is undefined }}"
ipaserver_setup_dns: true
ipasssd_enable_dns_updates: true
1 change: 1 addition & 0 deletions roles/freeipa_client/vars/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# Copyright 2024 Cloudera, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
Loading