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

Add possibilty to force install components #132

Open
3sky opened this issue Feb 18, 2021 · 4 comments
Open

Add possibilty to force install components #132

3sky opened this issue Feb 18, 2021 · 4 comments
Assignees

Comments

@3sky
Copy link

3sky commented Feb 18, 2021

Hi, I'm playing a bit with yours tool and it's really useful, thanks.

However I found, some use case which will be nice to improve IMO.
Let's assume that while run edb-deployment configure, unfortunately we provide typo in password. We realized that when we run ansible playbook, which fails. We change our user:password in ansible_vars.json. In second run we get

Failed to download metadata for repo 'edb': Cannot download repomd.xml.

All because wrong initial configuration.
Original playbook has this option called force_install https://github.com/EnterpriseDB/edb-ansible/blob/master/roles/setup_repo/defaults/main.yml#L26. I will be nice to have it in yours tool.
The simplest solution will be adding in line 615 of file postgres-deployment/edbdeploy/project.py

force_install=self.ansible_vars['force_install']

But it require manual change in ansible_vars. Maybe it should be managed via --force flag in edb-deployment deploy ? I'd like to know your opinion about that before implementation.

@jt-edb jt-edb self-assigned this Feb 19, 2021
@jt-edb
Copy link
Contributor

jt-edb commented Feb 19, 2021

Hi @3sky

Thank you for this well detailed case.

But it require manual change in ansible_vars. Maybe it should be managed via --force flag in edb-deployment deploy ? I'd like to know your opinion about that before implementation.

I do agree with you, we should have a way to pass Ansible extra vars from edb-deployment CLI to ansible-playbook. Not only for the force_install var., I think it could be useful for the force_initdb var. too and probably others.

My idea is to add the new CLI option -e/--extra-vars to the deploy sub-command. This option would take a JSON object value, if not null, then we should merge this JSON object into the ansible_vars.json file before executing ansible-playbook.

In this case, the command would be:

$ edb-deployment <cloud-vendor> deploy -e '{"force_install": true}'

What do you think?

@3sky
Copy link
Author

3sky commented Feb 19, 2021

Thanks for fast response.
I like this approach, however it will be problematic in case of documentation/user manual. Operator will need to open ansible collection, find right flag description etc.
What about the same flags system as in configure command like:

$ edb-deployment <cloud-vendor> deploy \
     --force-install=true \
     --force_initdb=true

# and help 
$ edb-deployment <cloud-vendor> deploy -h 
usage: edb-deployment <cloud-vendor>  deploy [-h] [-n] <project-name>

positional arguments:
  <project-name>        Project name

optional arguments:
  -h, --help            show this help message and exit
  -n, --no-install-collection
                        Do not install the Ansible collection.
  -f, --force-install
                        While installing components refresh repository cache. Default: false
  -i, --force_initdb
                        Init DB after instalation. Default: true

@jt-edb
Copy link
Contributor

jt-edb commented Feb 19, 2021

I like this approach, however it will be problematic in case of documentation/user manual. Operator will need to open ansible collection, find right flag description etc.

Good point, this is more user friendly.

Considering this, I'll add both -f/--force-install (bool, default: false) and -i/--force-initdb (bool, default: false) CLI options for the deploy sub-command.

@vibhorkumar123 any comment?

@vibhorkumar123
Copy link
Contributor

I think it makes sense to me. We also need to define different sets of force_* variables in ansible. Right now, force_install is also force reconfiguration for install_dbserver and setup_efm.

jt-edb added a commit to jt-edb/postgres-deployment that referenced this issue Feb 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants