This is an internal documentation. There is a good chance you’re looking for something else. See Disclaimer.
Ansible: New WordPress Instance
Add DNS Entry
Main Record
Always create this record. All other WordPress records should point to this one [1]:
${INSTALLATION}.wp.tocco.ch |
IN CNAME |
${SERVER} |
where ${SERVER} is one of:
Environment |
Server |
|---|---|
production / pilot |
wp2.prod.tocco.ch |
test |
wp2.stage.tocco.ch |
WordPress on tocco.ch
WordPress on our domain preferably follows the following pattern:
web.${INSTALLATION}.tocco.ch |
IN CNAME |
${INSTALLATION}.wp.tocco.ch |
|
tocco.web.${INSTALLATION}.tocco.ch |
IN CNAME |
${INSTALLATION}.tocco.ch |
WordPress on Customer Domain
Custom domains should look like this:
${FQDN} |
IN CNAME |
${INSTALLATION}.wp.tocco.ch |
|
tocco.${FQDN} |
IN CNAME |
${INSTALLATION}.tocco.ch |
With test systems using an additional ‘test-’ prefix:
test-${FQDN} |
IN CNAME |
${INSTALLATION}.wp.tocco.ch |
|
tocco.test-${FQDN} |
IN CNAME |
${INSTALLATION}.tocco.ch |
Hint
See also DNS (Wordpress) and DNS (Nice).
Create WordPress Instance
Warning
If you haven’t setup Ansible yet, now is time to follow the instructions in Setup Ansible and read through Ansible: Usage.
Update your Ansible Repository clone:
cd ${PATH_TO_ANSIBLE_REPOSITORY}/wordpress # Note the `/wordpress` git pull --rebase
Add customer/installation to
tocco/config.yml# ... abc: # ... installations: abc: wordpress: abc: # WordPress instance name routes: web.abc.tocco.ch: # WordPress route # # Route for 'tocco.' is added implicitly. # ... wordpress_server: wp2.prod.tocco.ch # Server, per table above abctest: wordpress: abctest: # WordPress instance name routes: web.abctest.tocco.ch: # WordPress route # # Route for 'tocco.' is added implicitly. # ... wordpress_server: wp2.stage.tocco.ch # Server, per table above # ...
Note
Naming conventions:
Instance name
Use same name for Nice and Wordpress. Only use another name when more than one WordPress instance is attached to a Nice installation.
Do not use testold / testnew in WordPress instance names. Rather attach the existing instance from test to testnew as needed.
Third party servers:
Set server to
nullwhen WordPress instance isn’t running on our servers:wordpress_server: null
Hint
More details about Ansible is available in Ansible: Usage
Run Ansible Playbook against WordPress
Skip for third-party servers.
Run playbook for WordPress instances abc and abctest:
cd ${GIT_ROOT}/wordpress ansible-playbook playbook.yml --skip-tags monitoring -l wp_abc,wp_abctestRun Ansible Playbook against Nice
Run playbook for Nice installation abc and abctest:
cd ${GIT_ROOT}/tocco ansible-playbook playbook.yml -l abc,abctestHave the Kiddies / 中号 set up the rest.
Enable Monitoring
Important
Only set up monitoring once the installation is online.
cd ${GIT_ROOT}/wordpress
ansible-playbook playbook.yml -t monitoring -l wp_abc,wp_abctest
Footnotes