OpenStack I18n translation check site
Long time ago (2015) I've started my OpenStack contributing process in OpenStack I18n team. The team is responsible for translating OpenStack dashboard, tools and documentation in other languages. One thing from the wishlist of the team was the Translation Check Site. And that was the biggest challenge for the team.
The Translation Check Site is a tool which makes the translation strings on the Horizon dashboard visible. Sounds simple? At the and: it is! All things what you need is OpenStack Ansible (OSA) and a virtual machine with at least 16 GB RAM and 70 GB disk space. Clone the repo and start the installation of OSA with gate-check-extensions:
Shell
git clone https://github.com/openstack/openstack-ansible /opt/openstack-ansible | |
cd /opt/openstack-ansible | |
./scripts/gate-check-commit.sh translations |
It takes up to 90-120 minutes to install the whole stack. Maybe as you know, OSA installs all services in LXC container, so you have a modular system simply to extend.
If the installation is finished now comes the magic of the installation! You need a cronjob for automation:
Shell
01,31 * * * * cd /opt/openstack-ansible/playbooks; openstack-ansible os-horizon-install.yml -e "horizon_translations_update=True" --tags "horizon-config" |
You can execute the command from command line. The ansible playbook will fetch the newest translation files from I18n translation server (Zanata), compile the files, restart the web server and you should be able to see your last changes from the translation server online. You can review your translation, editing again, call the command above or wait 30 minutes for a new fetch.
Of course, you need login data for the dashboard on your machine. OSA provides an autogenerated password. You can found it in /etc/openstack_deploy/user_secrets.yml
Shell
keystone_auth_admin_password: 8a8bb99309b8385603d3cd911d45fd2204df3bc2522e92a4ec9431f5 |
In the cloud we want to automate all the things. Here is a shell script to install SOA via puppet. It's developed for a system in a serverless puppet infrasructure:
Here is also an user-data file if you want to boostrap a virtual machine in this way: https://github.com/eumel8/translation_checksite/blob/aio/user-data
Adjust $admin_email
. The dashboard admin password would you receive on this address.
If you want to use Open Telekom Cloud as cloud provider here are a complete solution:
- Install Ansible and configure your os-client-config like 1) in https://github.com/eumel8/ansible-otc/blob/master/CONNECT.md
Clone the git repo with OTC ansible roles
Shell
git clone -b dev https://github.com/eumel8/ansible-otc
- adjust tenant.ini
Shell
[DEFAULT]
image_name=Community_Ubuntu_16.04_TSI_latest
availability_zone=eu-de-01
evs_availability_zone=eu-de-01
vpc_name=i18n-vpc01
vpc_net=192.168.0.0/16
subnet_name=i18n-subnet01
subnet_net=192.168.0.0/24
subnet_gateway=192.168.0.1
subnet_dhcp_enable=true
subnet_primary_dns=8.8.8.8
subnet_secondary_dns=8.4.4.8
ecs_adminkey=i18n-key
keypair_file=~/.ssh/id_rsa.pub
[i18n]
ecs_volumesize=100
ecs_volumetype=SSD
ecs_ram=16000
ecs_vcpus=4
ecs_publicip=0.0.0.0
eip_bandwidth_name=ansible-i18n
eip_bandwidth_size=500
secgroup_name=ansible-secgroup01
secgroup_rule1=ingress;IPv4;tcp;22;22;0.0.0.0/0
secgroup_rule2=ingress;IPv4;tcp;80;80;0.0.0.0/0
secgroup_rule3=ingress;IPv4;tcp;443;443;0.0.0.0/0
secgroup_rule4=ingress;IPv4;icmp;;;0.0.0.0/0
Fetch user-data file from https://raw.githubusercontent.com/eumel8/translation_checksite/aio/user-data. Adjust
admin_email
like above. But beware: It's not possible to send out e-mail directly in OTC. You need to configure relayhost out-cloud.mms.t-systems-service.com in /etc/postfix/main.cf or doing this in user-data before install the postfix package:
debconf-set-selections <<< "postfix postfix/relayhost string out-cloud.mms.t-systems-service.com"Run ansible to bootstrap the server
Shell
ansible-playbook -i hosts tenant_create.yml -e "ecs_name=i18n" -e "ecs_user_data=$(base64 -w 0 user-data )"
FInish!
Maybe you want to install your own ssl certificate in your OSA server. In this case you have cert file, key file and ca cert file with the corespondending data. Take the files on the OSA server and provide the paths in a yml file:
/home/ubuntu/cert.yml
Shell
haproxy_user_ssl_cert: /etc/ssl/certs/server.crt | |
haproxy_user_ssl_key: /etc/ssl/certs/private/server.key | |
haproxy_user_ssl_ca_cert: /etc/ssl/certs/ca.crt |
Call haproxy playbook to install the new certificat and restart haproxy:
Shell
cd /opt/openstack-ansible/playbooks | |
ansible-playbook haproxy-install.yml -e @/home/ubuntu/cert.yml |
That's it. PoC files are available on https://github.com/eumel8/translation_checksite/tree/aio
Thanks to @andymccrae, Rob Cresswell and all the teams who worked together: #WeAreOpenStack