Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ####### Playbook provision.yml ###################
- - hosts: mw_hosts
- # use strategy: debug when you want to debug your playbook
- strategy: debug
- gather_facts: no
- vars_files:
- - defaults/main.yml
- - vars.yml
- pre_tasks:
- - name: Record hostname if not defined
- set_fact:
- wiki_hostname: "{{ inventory_hostname }}"
- when: wiki_hostname is undefined
- - name: Wait for new host to come up
- local_action: wait_for host={{ ansible_ssh_host }} port=22 state=started delay=0
- tags: [connect]
- - setup:
- - include: tasks/swap.yml
- tags: [whitebox, disk]
- - include: tasks/software.yml
- tags: [whitebox, packages]
- - include: tasks/security.yml
- tags: [whitebox, security]
- - include: tasks/users.yml
- tags: [whitebox, users]
- handlers:
- - include: handlers/site.yml
- # install all the goodness
- roles:
- - { role: qualitybox, tags: ["qualitybox", "mediawiki"] }
- - { role: install_git, tags: ["qualitybox", "mediawiki"] }
- - { role: deploy_mw_host, tags: ["qualitybox", "mediawiki"] }
- # Add more plays to the playbook
- - include: install_mediawiki.yml
- - include: install_extensions.yml
- - include: install_skins.yml
- # finally create the wiki
- # - include: create_new_wiki.yml
- # - vars: WIKI_NAME=mywiki
- ######### Which eventually includes roles/install_mediawiki/tasks/main.yml ############
- ######### containing task ############
- - name: grant access to empty wiki to wiki user (db host != wiki host)
- mysql_user:
- name={{ MYSQL_WIKI_USER }}
- password={{ MYSQL_WIKI_PASSWORD }}
- priv="{{ EMPTY_WIKI_NAME }}.*:SELECT,INSERT,UPDATE,DELETE,INDEX,ALTER,CREATE,DROP,CREATE TEMPORARY TABLES"
- append_privs=true
- host={{ wiki_hostname }}
- login_user=root
- when: inventory_hostname != wiki_hostname
- ####### Gives this output ###########################################################
- TASK [install_mediawiki : grant access to empty wiki to wiki user (db host != wiki host)] ***
- task path: /home/greg/src/ansible-digitalocean/roles/install_mediawiki/tasks/main.yml:36
- fatal: [wiki.example.com]: FAILED! => {
- "failed": true,
- "msg": "The conditional check 'inventory_hostname != wiki_hostname' failed. The error was: error while evaluating conditional (inventory_hostname != wiki_hostname): 'wiki_hostname' is undefined\n\nThe error appears to have been in '/home/greg/src/ansible-digitalocean/roles/install_mediawiki/tasks/main.yml': line 36, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n# These steps assume that QualityBox role has already been run to create .my.cnf\n- name: grant access to empty wiki to wiki user (db host != wiki host)\n ^ here\n"
- }
- NO MORE HOSTS LEFT *************************************************************
- to retry, use: --limit @provision.retry
- PLAY RECAP *********************************************************************
- wiki.example.com : ok=9 changed=3 unreachable=0 failed=1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement