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

Replace foreman_installer role #516

Closed
wants to merge 1 commit into from

Conversation

sean797
Copy link
Member

@sean797 sean797 commented Aug 15, 2017

This replaces foreman_installer role with https://github.com/sean797/ansible-role-foreman_installer (https://galaxy.ansible.com/sean797/foreman_installer/)

A couple of benefits this provides:

  • Generates Proxy Certs on the fly (replaces the current foreman_proxy_content role)
  • Automatically get oauth key's and secrets from the Foreman or Katello Server.

I've added it via git submodule as its also on Galaxy and I think it makes sense to not host it in forklift. I'm happy to define it in requirements.yml and/or move it to theforeman GitHub org.

I haven't changed pipelines/pipeline_katello_31.yml or pipelines/pipeline_katello_30.yml. Happy to do so, but I think they may be worth removing now, considering how old they are?

@sean797 sean797 force-pushed the f-installer branch 5 times, most recently from a0ae2f9 to 6f332b0 Compare August 15, 2017 15:20
@ekohl
Copy link
Member

ekohl commented Aug 15, 2017

While I'm open to the idea, this will take some time to review I think.

We should also look at the bigger picture: is a submodule the way to go? @ehelms also started https://github.com/theforeman/foreman-ansible-modules so perhaps there's more we can converge on in terms of using external repositories and how we do that.

@ehelms
Copy link
Member

ehelms commented Aug 15, 2017 via email

@sean797
Copy link
Member Author

sean797 commented Aug 15, 2017

I agree with your points about submodules, I opted for that because requirements.yml is in .gitignore and defining roles in requirements.yml would require another step to pull down the role(s). Not the end of the world I guess, either way works. There are pros and cons of both.

A flexible foreman_installer Ansible role is missing on Galaxy, so I want to be able to publish there. AFAIK its 1 git repo -> 1 role mapping (requiring a /meta/main.yml file), hosting it in Forklift would result in problems importing it into Galaxy I think.

Proxy certs tar generation:
You provide a generate_proxy_certs_from var and it will go and generate the certs, copy them over, make all the oauth stuff correct and do the install.

HA support:
See https://github.com/sean797/ansible-role-foreman_installer#katello-cluster-with-custom-certificates
Basically it can setup oauth, other password answers, /etc/foreman/encryption_key.rb so they're the same.

  • Automatically get oauth key's and secrets from the Foreman or Katello Server.

As opposed to?

With the current role you have to do something like https://github.com/theforeman/forklift/blob/master/pipelines/pipeline_katello_nightly.yml#L61 supply the options you get, whereas this role will do that for you providing you supply generate_proxy_certs_from var.

The main reason behind this is I've created a flexible foreman_installer role, and it seem unnecessary for the me or the project to maintain both (and I want to share it ;-) )

@ehelms
Copy link
Member

ehelms commented Aug 15, 2017 via email

@@ -19,9 +19,6 @@
katello_repositories_version: 3.2
foreman_repositories_version: 1.13
katello_repositories_use_koji: true
foreman_installer_skip_installer: true
foreman_installer_additional_packages:
- foreman-installer-katello
Copy link
Member

Choose a reason for hiding this comment

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

Why remove these? They help to optimize runs.

Copy link
Member Author

@sean797 sean797 Aug 15, 2017

Choose a reason for hiding this comment

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

The role I'm proposing replacing this with doesn't have a foreman_installer_skip_installer or similar var, I think having a foreman_installer role that dosen't actually run the installer is kind of pointless.

If we want to just install packages, maybe we should extend the update_os_packages role or create a os_packages role.

- "--foreman-admin-password {{ foreman_installer_admin_password }}"
foreman_installer_additional_packages:
- katello
installer_scenarios_answers:
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this be foreman_installer_scenarios_answers ?

Copy link
Member Author

Choose a reason for hiding this comment

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

👍 I probably should rename that var...

- katello
installer_scenarios_answers:
foreman:
admin_password: changeme
Copy link
Member

Choose a reason for hiding this comment

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

Why set this this way in contrast to the foreman_installer_options? What advantage is there to having two ways to configure the installer?

Copy link
Member Author

Choose a reason for hiding this comment

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

This makes the role idempotent, if you modify foreman_installer_options you have to run the installer to make sure its applied (everytime), wheras this method allows you to manage the answer file and run the installer as a handler (only if something changes). https://github.com/sean797/ansible-role-foreman_installer/blob/master/templates/scenario-answers.yaml.j2

installer_scenarios_answers:
foreman:
admin_password: changeme
foreman_installer_pkg: katello
Copy link
Member

Choose a reason for hiding this comment

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

This option, that replaced the previous was an array, while this is a single option -- why the change?

Copy link
Member Author

@sean797 sean797 Aug 15, 2017

Choose a reason for hiding this comment

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

I never had any need to install more than 1 package, I'll happily change it to take an array if required. I can't see anywhere where is actually need?

roles:
- foreman_installer

- hosts: pipeline-proxy-3.2-centos7
become: yes
vars:
foreman_proxy_content_server: pipeline-katello-3.2-centos7
generate_proxy_certs_from: pipeline-katello-3.2-centos7.example.com
Copy link
Member

Choose a reason for hiding this comment

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

This is missing the foreman_installer namespace. This will also break because you are baking in the domain even though the domain is dynamically generated when using Vagrant.

foreman:
admin_password: changeme
katello:
enable_ostree: true
Copy link
Member

Choose a reason for hiding this comment

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

Indentation is off here

@ehelms
Copy link
Member

ehelms commented Aug 15, 2017

Some of my review comments apply in multiple places, so I did not repeat myself for the sake of us all.

@ehelms
Copy link
Member

ehelms commented Aug 15, 2017 via email

@ehelms
Copy link
Member

ehelms commented Aug 15, 2017 via email

@ehelms
Copy link
Member

ehelms commented Aug 15, 2017 via email

@sean797 sean797 force-pushed the f-installer branch 6 times, most recently from 9f35aca to 1daa1b4 Compare August 21, 2017 13:24
@sean797
Copy link
Member Author

sean797 commented Aug 23, 2017

Update, I think I addressed all your comments @ehelms. Thanks!

@sean797
Copy link
Member Author

sean797 commented Oct 19, 2017

@ehelms @ekohl Any chance you can take a look at this again?

@ekohl
Copy link
Member

ekohl commented Oct 19, 2017

I'd love to, but I've been very much focused on getting releases out and builds stable. 1.16 RC2 is long overdue. Even my own work with split installs has stalled. After that's settled down a bit I'll make time.

@sean797
Copy link
Member Author

sean797 commented May 4, 2018

@ehelms @ekohl I know you guys are busy but is their still appetite to replace the current role for an idempotent one? I find it quite frustrating using forklift with production boxes always runs the installer. Just to reiterate, I'm happy to move the role to theforeman GitHub Org or host it in Forklift.

What might work is, hosting the role in Forklift and setting up a Jenkins job (can be trigger via a Github webhook) that pushes any changes to a dedicated repo for the Ansible role, that would allow it to be put on Galaxy and other Users to make use of it. We could obviously do the same thing for other roles. Though obviously setting up Jenkins could be somewhat time-consuming and a PITA.

@ekohl
Copy link
Member

ekohl commented May 4, 2018

@sean797 you're right that I'm too busy to give proper attention to the various PRs. This large PR with some architectural implications is an easy victim. I think it'd be good to start a discourse thread about expanding the group of maintainers on this repository. I'd be happy to pass on maintenance to others while remaining available for questions.

@ehelms
Copy link
Member

ehelms commented Jan 9, 2020

@sean797 This has sat for a while, and I think we are still on the fence about moving this out to it's own repository.

@sean797
Copy link
Member Author

sean797 commented Jan 13, 2020

Yea - lets close this

@sean797 sean797 closed this Jan 13, 2020
@sean797 sean797 deleted the f-installer branch January 13, 2020 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants