- Ansible >=2.5: https://docs.ansible.com/ansible/latest/installation_guide/index.html
- Python 3: Needed by the OpenStack command line tools
- Access to Pouta
- Your cPouta project's OpenStack RC file
- Key pair for cPouta instances. Created in https://pouta.csc.fi/ (Project > Compute > Key Pairs) and must be named "kielipouta".
For Python requirements, it is recommended to use a virtual environment:
virtualenv .venv -p python3
source .venv/bin/activate
pip install -r requirements_dev.txt
The activation step must be done separately for each new session.
After that, external ansible roles can be installed via
ansible-galaxy install -r requirements.yml
The OpenStack auth file is necessary for provisioning the OpenStack resources.
$ source project_2000680-openrc.sh
To ensure that you can establish an SSH connection from your local machine to korp2.csc.fi from outside the office network (VPN still needed), add the following entries to your .ssh/config
:
host korp.csc.fi
HostName korp.csc.fi
ForwardAgent yes
User cloud-user
IdentityFile ~/.ssh/id_rsa
host korp2.csc.fi
HostName korp2.csc.fi
ProxyJump korp.csc.fi
User cloud-user
Modify the IdentityFile
path if needed. Establishing a connection to korp2.csc.fi should now work via korp.csc.fi (i.e. the playbook should run without issues).
Development instance is created on Pouta and uses a local database. No corpora are included out of the box.
$ ansible-playbook korp-pouta.yml -i inventories/korp-dev
Accessing a newly created instance requires updating the IP in (pre-prod) proxy settings: see proxy repo for more details.
Run the provisioning playbook.
$ ansible-playbook korp-production.yml -i inventories/korp-prod
By default, some files are downloaded locally into ~/Downloads
. If you do not
wish to use that directory, specify an alternative using --extra-vars "local_download_dir=your/path/here"
.
The script will recompile the frontend in case of changes (including new news). You can force the recompilation and reinstallation of the frontend using
the force_compile
parameter, e.g.:
$ ansible-playbook -vi inventories/korp-prod korp-production.yml -t korp-frontend -e force_compile=true
To just update the news information you can start later in the script:
$ ansible-playbook -vi inventories/korp-prod korp-production.yml -t korp-frontend --start-at="update worktrees" -e force_compile=true