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

Proposal: Add 'installation_only' flag to roles #1086

Open
beargiles opened this issue May 3, 2023 · 3 comments · May be fixed by #1087
Open

Proposal: Add 'installation_only' flag to roles #1086

beargiles opened this issue May 3, 2023 · 3 comments · May be fixed by #1087

Comments

@beargiles
Copy link

Proposal: add 'installation_only' flag to roles.

Motivation

It takes many minutes to download and install the software. We can do a little ahead of time, e.g., installing the idm:DL1/* packages, but I know that the roles install a lot of packages and it would be difficult for individuals to keep up to date with changes.

We could save many minutes if we could use an AMI that has already downloaded and installed all of the software required by the role.

Proposal

The preparation follows:

  • create a fresh instance
  • run 'install' with an 'installation_only' flag set
  • create an AMI

(This is easy to do with molecule)

During testing and deployment we could start with that AMI, instead of the official OS image or our customization of it, and jump straight to the configuration. The scripts will still need to verify that the proper software is installed but that's a lot faster than the initial download and installation.

Enhancement

Many of the services require information that's only available at deployment, e.g., the actual hostname and IP address of the host.

However some services are either completely agnostic to the role's properties or only require information that's constant across all instances. E.g., the domain, realm, LDAP properties, etc., will often be the same within a smaller organization. (Or if the decision is made to create a series of AMI images.)

In those cases the preparation step could include initialization of those services when possible. It's unlikely to make a big difference with the server or replica but might greatly simplify the final configuration of the client since so much will already be known by that point.

@t-woerner
Copy link
Member

There are the parameters ipaserver_install_packages and ipareplica_install_packages and ipaclient_install_packages.

These define if packages will be installed on the node and default to true. Setting these to false for the matching role will skip the package installation step completely. For example to speed up test deployments if the needed packages are already installed. There is no verification if the needed packages are installed, though.

@rjeffman
Copy link
Member

rjeffman commented May 3, 2023

There is no way to partially install IPA, the only steps available are install packages and configure IPA. There's no steps where we can stop the installation process (not without leaving the host in an unstable and possibly unknown state).

Most of the time spent in the installation is in downloading packages (might add up to 2/3 of the time). If you want to save this time you can create a custom image with the packages installed, but unconfigured, and then use *_install_packages: false, as said before.

To only install the packages you may use:

- ansible.builtin.package:
    name: "idm:DL1"

Check the roles vars.yaml files for packages required for different distro versions.

@t-woerner
Copy link
Member

Now I got it. You want to install the needed packages only and skip the deployment.

t-woerner added a commit to t-woerner/ansible-freeipa that referenced this issue May 4, 2023
The bool value defines if the deployment will continue after the needed
packages are installed on the node.

This is useful if images are generated with the packages installed to speed
up deployment.

Fixes: freeipa#1086 (Proposal: Add 'installation_only' flag to roles)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants