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

ipa{server,replica,client}: Add parameter to support to install packages only #1087

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
1 change: 1 addition & 0 deletions roles/ipaserver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ Special Variables
Variable | Description | Required
-------- | ----------- | --------
`ipaserver_install_packages` | The bool value defines if the needed packages are installed on the node. (bool, default: true) | no
`ipaserver_install_packages_only` | The bool value defines if the deployment will continue after the needed packages are installed on the node. (bool, default: true) | no
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ipaserver/defaults/main.yml has ipaserver_install_packages_only: false, shouldn't the default be false?

Also, I think the value should be true if only the packages should be installed, so, in my opinion, description should be something like "When set to true, required packages will be installed, but server will not be configured. (bool, default: false)"

`ipaserver_setup_firewalld` | The value defines if the needed services will automatically be opened in the firewall managed by firewalld. (bool, default: true) | no
`ipaserver_firewalld_zone` | The value defines the firewall zone that will be used. This needs to be an existing runtime and permanent zone. (string) | no
`ipaserver_external_cert_files_from_controller` | Files containing the IPA CA certificates and the external CA certificate chains on the controller that will be copied to the ipaserver host to `/root` folder. (list of string) | no
Expand Down
1 change: 1 addition & 0 deletions roles/ipaserver/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ ipaserver_enable_compat: no
ipaserver_setup_ca: yes
### packages ###
ipaserver_install_packages: yes
ipaserver_install_packages_only: false
### firewalld ###
ipaserver_setup_firewalld: yes

Expand Down
10 changes: 7 additions & 3 deletions roles/ipaserver/tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@


- name: Install - Firewall configuration
when: ipaserver_setup_firewalld | bool
when: ipaserver_setup_firewalld | bool and
not ipaserver_install_packages_only
block:
- name: Firewalld service - Ensure that firewalld is running
ansible.builtin.systemd:
Expand All @@ -55,7 +56,8 @@
- name: Copy external certs
ansible.builtin.include_tasks: "{{ role_path }}/tasks/copy_external_cert.yml"
with_items: "{{ ipaserver_external_cert_files_from_controller }}"
when: ipaserver_external_cert_files_from_controller is defined and
when: not ipaserver_install_packages_only | bool and
ipaserver_external_cert_files_from_controller is defined and
ipaserver_external_cert_files_from_controller|length > 0 and
not ipaserver_external_cert_files is defined

Expand Down Expand Up @@ -128,10 +130,12 @@
secondary_rid_base: "{{ ipaserver_secondary_rid_base | default(omit) }}"

### additional ###
when: not ipaserver_install_packages_only | bool
register: result_ipaserver_test

- name: Install - Deploy server
when: not ansible_check_mode and not
when: not ansible_check_mode and
not ipaserver_install_packages_only | bool and not
(not result_ipaserver_test.changed and
(result_ipaserver_test.client_already_configured is defined or
result_ipaserver_test.server_already_configured is defined))
Expand Down