Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0
Ce dépôt a été archivé le 2022-05-07. Vous pouvez voir ses fichiers ou le cloner, mais pas ouvrir de ticket ou de demandes d'ajout, ni soumettre de changements.
nyaa-pantsu/deploy/ansible/swap_elasticsearch_index.yml
tomleb 991fc73c4e Update elasticsearch index playbooks (#892)
* Update elasticsearch index swapping playbooks

* Add ansible syntax check

* Document index swapping

* Update .travis.yml

* Update .travis.yml

* Update .travis.yml

* Update .travis.yml

* Update .travis.yml
2017-06-04 10:28:26 +10:00

28 lignes
971 o
YAML

# We're not putting elasticsearch role because we don't want to re-enable the
# reindexing cron job before we've actually made the swap
- name: Populate elasticsearch index from database
hosts: dbs
roles:
- common
- postgresql
tasks:
- name: Swap elasticsearch index
uri:
url: "http://localhost:9200/_aliases"
method: POST
body_format: json
body:
actions:
- remove:
index: "{{ nyaapantsu_elasticsearch_old_index }}"
alias: "{{ nyaapantsu_elasticsearch_alias }}"
- add:
index: "{{ nyaapantsu_elasticsearch_index }}"
alias: "{{ nyaapantsu_elasticsearch_alias }}"
- name: Re-enable reindex cron job
command: mv "/tmp/reindex_{{ nyaapantsu_torrent_tablename }}" /etc/cron.d/
become: true
ignore_errors: yes # Can ignore error here if the file had previously been
# moved.