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

Install scripts don't allow use of Ansible's --start-at-task flag #424

Open
PaulKiddle opened this issue Sep 17, 2020 · 1 comment
Open

Comments

@PaulKiddle
Copy link

PaulKiddle commented Sep 17, 2020

If my install fails halfway through and I need to re-run, I can't use Ansible's --start-at-task option, because of the required calls to set_fact in in the common role. This means running the entire process again including unnecessary large downloads.

It might be better to set these variables in "group_vars" using a combination of the "default" filter and other logic, or at least import the common tasks at the start of roles that require them to have been run.

@vjrj
Copy link
Collaborator

vjrj commented Sep 18, 2020

About large downloads, we use skip/skip-tags:
https://github.com/AtlasOfLivingAustralia/documentation/wiki/FAQ#so-what-happens-when-i-rerun-the-ansible-it-doesnt-like-make-two-versions-of-everything
although in the case of the nameindex, in a near future will not download again.

About repeating/reruning ansible: we use the --tags, for instance to repeat some war deploy (because I changed some service version) with common,deploy tags. In our case, we use the ansible wrapper:

$  ./ansiblew --alainstall=../../ala-install-up-to-date collectory --tags=common,deploy
ansible-playbook -u ubuntu -i gbif-es-inventory.ini -i gbif-es-local-extras.ini -i gbif-es-local-passwords.ini ../../ala-install-up-to-date/ansible/collectory-standalone.yml --tags common,deploy --limit colecciones.gbif.es --extra-vars ala_install_repo=../../ala-install-up-to-date

other tags I use:

  • --tags properties: when I change something in the configuration
  • --tags nginx,nginx_vhost: when I only want to reconfigure the nginx vhosts

but many times I run the entire playbook skipping downloads to be sure that ends correctly.

For instance if I want to deploy or update our biocache, using the ansiblew wrapper without --nodryrun only to show the real ansible-playbook command:

$ ./ansiblew --alainstall=../../ala-install-up-to-date ala_hub --skip=nameindex                                   
ansible-playbook -u ubuntu -i gbif-es-inventory.ini -i gbif-es-local-extras.ini -i gbif-es-local-passwords.ini ../../ala-install-up-to-date/ansible/biocache-hub-standalone.yml --skip-tags nameindex --limit registros.gbif.es --extra-vars ala_install_repo=../../ala-install-up-to-date

and this skips the nameindex download.

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

No branches or pull requests

2 participants