ccollicutt / swiftacular

Deploy OpenStack Swift with Ansible and Vagrant
BSD 2-Clause "Simplified" License
47 stars 13 forks source link

with_sequence failing on disks #25

Closed brainstorm closed 10 years ago

brainstorm commented 10 years ago

While most of the playbook runs smoothly, I've bumped into this:

TASK: [storage | check if losetup loop1 is already up] ************************
failed: [192.168.5.5] => {"changed": true, "cmd": "mount | grep \"loop1 \"", "delta": "0:00:00.004437", "end": "2014-08-07 14:43:39.761026", "rc": 1, "start": "2014-08-07 14:43:39.756589", "stdout_lines": []}
...ignoring

TASK: [storage | umount swift disks] ******************************************
fatal: [192.168.5.5] => unknown error parsing with_sequence arguments: u'count={{ disks }}'

FATAL: all hosts have already failed -- aborting

I'm running ansible 1.7 (latest version released today).

ccollicutt commented 10 years ago

Thanks for the report, I'll look into this tonight.

ccollicutt commented 10 years ago

I just upgraded to ansible 1.7, and reran swiftacular on osx with the trusty64 vagrant box and didn't get that error.

curtis$ ansible-playbook --version
ansible-playbook 1.7

What's your environment like?

brainstorm commented 10 years ago

Strange, putting an integer (3, for instance) instead of {{ disks }} does fix the issue for me. Don't know why it's failing to expand the disks variable.

Maybe I'm missing sth, but other than host_vars/swift-storage-0* where is disks defined? Next issues I'm getting further down the process:

TASK: [storage | check if account.ring.gz already exists] *********************
failed: [192.168.5.5] => {"changed": true, "cmd": ["ls", "/etc/swift/account.ring.gz"], "delta": "0:00:00.003721", "end": "2014-08-12 13:56:21.402436", "rc": 2, "start": "2014-08-12 13:56:21.398715", "stdout_lines": []}
stderr: ls: cannot access /etc/swift/account.ring.gz: No such file or directory
...ignoring

And also related to the disks variable expansion in the swift rings creation:

TASK: [storage | build account ring] ******************************************
fatal: [192.168.5.5 -> 192.168.5.6] => unknown error parsing with_sequence arguments: u'count={{ disks }}'

FATAL: all hosts have already failed -- aborting

Regarding my environment:

$ uname -a
Darwin mba.local 13.3.0 Darwin Kernel Version 13.3.0: Tue Jun  3 21:27:35 PDT 2014; root:xnu-2422.110.17~1/RELEASE_X86_64 x86_64

$ ansible-playbook --version
ansible-playbook 1.7
ccollicutt commented 10 years ago

Sorry missed this in my email.

I don't think disks should be defined anywhere but in the host_vars for that host.

The check if storage rings is Ok because it's just checking to see if they are there, and if not it'll create them.

Let me look again at it...

ccollicutt commented 10 years ago

I checked on the ansible irc channel, it should be ok to use a variable with with_sequence. I have to wonder if there is just something weird with your env somehow...???

brainstorm commented 10 years ago

Yes, I guess it could be some of my local modifications:

https://github.com/brainstorm/ansible-dataspace/tree/master/roles/swift

My intention is to deploy on bare metal instead of Vagrant, going through a bastion host:

http://alexbilbie.com/2014/07/using-ansible-with-a-bastion-host/

Granted, I could have used other Vagrant provisioners for that, but I wanted to trim down swiftacular a bit, I guess I've broken something in the process, sorry for bothering you :-S