Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NEXT] AgoraGui, config setup fail in deployment system #66

Open
Hilfe opened this issue Apr 11, 2016 · 5 comments
Open

[NEXT] AgoraGui, config setup fail in deployment system #66

Hilfe opened this issue Apr 11, 2016 · 5 comments

Comments

@Hilfe
Copy link

Hilfe commented Apr 11, 2016

Provisoning Agora server show the next fail:

TASK: [AgoraGui, config setup] *******************************************************************
fatal: [default] => {'msg': "AnsibleUndefinedVariable: One or more undefined variables: 'dict object' has no attribute 'name'", 'failed': True}
fatal: [default] => {'msg': "AnsibleUndefinedVariable: One or more undefined variables: 'dict object' has no attribute 'name'", 'failed': True}
FATAL: all hosts have already failed -- aborting

@nfortea
Copy link

nfortea commented Jun 24, 2017

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'

@nfortea
Copy link

nfortea commented Jun 24, 2017

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?

@Findeton
Copy link
Contributor

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)

@nfortea
Copy link

nfortea commented Jun 25, 2017

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?

@nfortea
Copy link

nfortea commented Jun 26, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants