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

Minor fixes #61

Merged
merged 10 commits into from
Dec 22, 2016
Merged

Minor fixes #61

merged 10 commits into from
Dec 22, 2016

Conversation

Mierdin
Copy link
Member

@Mierdin Mierdin commented Dec 21, 2016

  • Fixed issue with roles location (pwd would be ansible-st2/playbooks so needs to go up a directory first to get to ansible-st2/roles)
  • Added .retry files to .gitignore

Matt Oswalt added 2 commits December 21, 2016 13:59
@arm4b
Copy link
Member

arm4b commented Dec 21, 2016

@Mierdin
Copy link
Member Author

Mierdin commented Dec 21, 2016

@armab I noted your reference to the ansible.cfg file, thanks for that. I suspect it's not getting picked up when I run with Vagrant, because before my changes here, I was getting this error (just sent stdout of ansible-galaxy command to a variable and debugged it):

==> default: Running provisioner: ansible...
    default: Running ansible-playbook...

PLAY [all] *********************************************************************

TASK [setup] *******************************************************************
ok: [default]

TASK [Install galaxy dependencies] *********************************************
changed: [default]

TASK [show message] ************************************************************
ok: [default] => {
    "msg": {
        "changed": true,
        "cmd": [
            "ansible-galaxy",
            "install",
            "-r",
            "roles/mistral/requirements.yml"
        ],
        "delta": "0:00:00.375551",
        "end": "2016-12-21 15:01:49.428682",
        "rc": 0,
        "start": "2016-12-21 15:01:49.053131",
        "stderr": "\u001b[0;31m [ERROR]: Unable to open roles/mistral/requirements.yml: [Errno 2] No such file\nor directory: u'roles/mistral/requirements.yml'\n\u001b[0m",
        "stdout": "",
        "stdout_lines": [],
        "warnings": []
    }
}

PLAY RECAP *********************************************************************
default                    : ok=3    changed=1    unreachable=0    failed=0

==> default: Running provisioner: ansible...

Or, in case it was being picked up but the path was wrong, I tried this (still didn't work):

[defaults]
roles_path=../roles/

@Mierdin
Copy link
Member Author

Mierdin commented Dec 21, 2016

@armab Ignore my last - I had my streams crossed. The problem is that the pwd will always be playbooks/ and since setup.cfg is a directory above that, it won't be seen unless explicitly referenced

Signed-off-by: Matt Oswalt <[email protected]>
Matt Oswalt added 2 commits December 21, 2016 15:39
Signed-off-by: Matt Oswalt <[email protected]>
Signed-off-by: Matt Oswalt <[email protected]>
@Mierdin
Copy link
Member Author

Mierdin commented Dec 22, 2016

So here's the long and short of it: it looks like the working directory will always be playbooks/, and there's no ansible.cfg there. So, the playbooks need to be in the same directory as ansible.cfg.

My current approach was to simply move everything out of playbooks/. Seems to work right now

@arm4b
Copy link
Member

arm4b commented Dec 22, 2016

@Mierdin That's really strange, because default Vagrantfile we have in place worked for me. Just re-ran it again to be sure, - no problems.

What's your Vagrant version and Ansible version BTW? My env:

ansible 2.2.0.0
Vagrant 1.8.6

It could be rather my old Vagrant version or your old version. Probably something changed between the versions, like Ansible provisioner implementation in Vagrant. Curious about any real reasons, because the fact that you can't run playbook from the sub-directory could be a sign of some deeper inconsistencies. Additionally, there is CI which re-uses same stackstorm.yml from non-root dir.

The reason I place example playbooks in sub-directory is that they're provided just for reference and example, which I would like to preserve if possible.
It's OK for users to create their own playbook where they can list roles from this repo, as well as provide special parameters for these roles.

Anyways, if we won't find anything interesting and that's the only way to fix things for you, - I'm OK with that as well.

end
config.vm.provision :ansible do |ansible|
ansible.playbook = "playbooks/stackstorm.yml"
ansible.playbook = "stackstorm.yml"
Copy link
Member

@arm4b arm4b Dec 22, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update README.md instructions with the new path.

@bigmstone
Copy link
Contributor

@armab Wouldn't work for me either. Running ansible 2.2.0 and vagrant 1.9.0

@arm4b
Copy link
Member

arm4b commented Dec 22, 2016

@bigmstone Thanks! This might be related to Vagrant version (1.8.6 vs 1.9.0). @Mierdin Please confirm you have 1.9.x as well.

So if it's Vagrant version logic, I'm OK with change, just update README.md and LGTM.
In a meantime, I'll update later my Vagrant to latest to see if I have the same Issue.

@Mierdin
Copy link
Member Author

Mierdin commented Dec 22, 2016

Hrm, I have Vagrant 1.8.6

@Mierdin Mierdin merged commit ddc4356 into StackStorm:master Dec 22, 2016
@Mierdin Mierdin deleted the ansible-fixes branch December 22, 2016 18:30
@arm4b arm4b added this to the v0.6.0 milestone Jan 11, 2017
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

Successfully merging this pull request may close these issues.

3 participants