Open Hilfe opened 8 years ago
I have a similar error when execute:
time sudo ansible-playbook -i inventory playbook.yml
I received:
TASK [AgoraElections, Default conf] ********************************************
fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg": "AnsibleUndefinedVariable: 'dict object' has no attribute 'share_social'"}
It's difficult to me find where is calling attribute 'share_social'
When I execute:
time sudo ansible-playbook -i inventory playbook.yml -vvv
I obtain:
TASK [AgoraElections, Default conf] ********************************************
task path: /home/agora/agora-dev-box/agora-elections/main.yml:34
fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "invocation": {"module_args": {"dest": "/home/agoraelections/agora-elections/conf/application.local.conf", "mode": "0644", "owner": "agoraelections", "src": "agora-elections/templates/application.local.conf"}, "module_name": "template"}, "msg": "AnsibleUndefinedVariable: 'dict object' has no attribute 'share_social'"}
Looking in main.yml, line 34
# Config files
- name: AgoraElections, Default conf
sudo: true
sudo_user: agoraelections
template: src=agora-elections/templates/application.local.conf dest=/home/agoraelections/agora-elections/conf/application.local.conf owner="agoraelections" mode=0644
Destination file /home/agoraelections/agora-elections/conf/application.local.conf dont' exist yet. However agora-elections/templates/application.local.conf in line 107
# social networks buttons configuration
share_social {
allow_edit = {% if config.agora_gui.share_social.allow_edit %}true{% else %} false{% endif %},
default = [
{% for button in config.agora_gui.share_social.default %}
{
network = "{{ button.network }}",
button_text = "{{ button.button_text }}",
social_message = "{{ button.social_message }}"
}{% if not loop.last %},{% endif %}
{% endfor %}
]
}
Some ideas?
I'm guessing the issue is with your config.yml. Specifically, it looks like it's missing 'share_social' dict, which should be under config.agora_gui. Look, for example, file config.yml on lines 452 to 461:
# social networks buttons configuration
share_social:
allow_edit: true
default:
- network: 'Twitter'
button_text: ''
social_message: 'I have just voted in election __URL__, you can too! #nvotes'
- network: 'Facebook'
button_text: ''
social_message: '__URL__'
Perhaps you have moved those lines and they are now not under agora_gui or you have removed them, or perhaps you have the wrong indentation (which would imply that share_social is not under agora_gui anymore)
The closest thing that i found in config.yml was on lines 423-430 on agora_gui:
423 # social networks footer links
424 social:
425 facebook: 'https://facebook.com/nvotes/'
426 twitter: 'https://twitter.com/nvotes'
427 twitterHandle: 'nvotes'
428 googleplus: 'https://plus.google.com/101939665794445172389/posts'
429 youtube: 'https://www.youtube.com/results?search_query=nvotes'
430 github: 'https://github.com/nvotes/'
I got the same after executing a git pull.
Are we taking about a copy of doc/production/config.master.yml?
I resolve coping lines from doc/production/config.auth.yml:
# social networks buttons configuration
share_social:
allow_edit: true
default:
- network: 'Twitter'
button_text: ''
social_message: 'I have just voted in election https://go.nvotes.com, you can too! #nvotes'
Thanks
Provisoning Agora server show the next fail: