Hi all

I'm running from HEAD (recently ran 'git pull --rebase && git submodule
update --init --recursive' following recent restructuring).

Unfortunately I can't tell which commit I was previously running from, but
I currently have an issue with the value of a variable being used from a
different role.

I have the following structure. Real repository details are substituted for
privacy but I have been careful to preserve the alphanumerical order of the
project names.

*deploy.yml*

- name: Configure instance(s) and deploy application
   hosts: launch
   user: root
   gather_facts: true

   roles:

     - role: deploy-projectB
       tags: deploy
       when: project == 'projectB' or project == 'subprojectB'

     - role: deploy-projectA
       tags: deploy
       when: project == 'projectA'

*roles/projectB/tasks/main.yml*

- name: what repo url and dir are we cloning?
   debug: msg="repo_url={{ repo_url }} repo_dir={{ repo_dir }}"

- name: Git clone
   git: repo={{ repo_url }}
        dest={{ repo_dir }}
        version={{ repo_branch }}
        accept_hostkey=yes

*roles/projectB/vars/main.yml*

repo_url: ssh://git@github.com/myorg/projectB.git
repo_dir: /usr/local/projectB/

*roles/projectA/vars.yml*

repo_url: ssh://git@github.com/myorg/projectA.git
repo_dir: /usr/local/projectA/


Now, when running the following: ansible-playbook -vvvv deploy.yml -e
'project=projectB repo_branch=feature/blah'

I get the following output and error when the projectB role is being
applied (the error is because the origin/feature/blah branch doesn't exist
on the projectA repo)

TASK: [deploy-system | what is going on?]
*************************************
<ec2-54-183-209-28.us-west-1.compute.amazonaws.com> ESTABLISH CONNECTION
FOR USER: root
ok: [ec2-54-183-209-28.us-west-1.compute.amazonaws.com] => {
     "msg": "repo_branch=feature/blah repo_url=ssh://
git@github.com/myorg/projectA.git repo_dir=/usr/local/projectA/"
}

TASK: [deploy-system | Git clone]
*********************************************
<ec2-54-183-209-28.us-west-1.compute.amazonaws.com> ESTABLISH CONNECTION
FOR USER: root
<ec2-54-183-209-28.us-west-1.compute.amazonaws.com> REMOTE_MODULE git
repo=ssh:********@github.com/myorg/projectA.git dest=/usr/local/projectA/
version=feature/blah accept_hostkey=yes
<ec2-54-183-209-28.us-west-1.compute.amazonaws.com> EXEC ssh -C -tt -vvv -o
ControlMaster=auto -o ControlPersist=60s -o
ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r -o
StrictHostKeyChecking=no -o Port=22 -o IdentityFile="/root/.ssh/id_rsa" -o
KbdInteractiveAuthentication=no -o
PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey
-o PasswordAuthentication=no -o ConnectTimeout=10
ec2-54-183-209-28.us-west-1.compute.amazonaws.com /bin/sh -c 'mkdir -p
$HOME/.ansible/tmp/ansible-tmp-1412002786.78-203481241742422 && echo
$HOME/.ansible/tmp/ansible-tmp-1412002786.78-203481241742422'
<ec2-54-183-209-28.us-west-1.compute.amazonaws.com> PUT /tmp/tmpAAFWjp TO
/root/.ansible/tmp/ansible-tmp-1412002786.78-203481241742422/git
<ec2-54-183-209-28.us-west-1.compute.amazonaws.com> EXEC ssh -C -tt -vvv -o
ControlMaster=auto -o ControlPersist=60s -o
ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r -o
StrictHostKeyChecking=no -o Port=22 -o IdentityFile="/root/.ssh/id_rsa" -o
KbdInteractiveAuthentication=no -o
PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey
-o PasswordAuthentication=no -o ConnectTimeout=10
ec2-54-183-209-28.us-west-1.compute.amazonaws.com /bin/sh -c
'LANG=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 /usr/bin/python2
/root/.ansible/tmp/ansible-tmp-1412002786.78-203481241742422/git; rm -rf
/root/.ansible/tmp/ansible-tmp-1412002786.78-203481241742422/ >/dev/null
2>&1'
failed: [ec2-54-183-209-28.us-west-1.compute.amazonaws.com] => {"failed":
true}
msg: Failed to checkout feature/blah

FATAL: all hosts have already failed -- aborting

As you can see, the {{ repo_url }} and {{ repo_dir }} variables from
projectA are being incorrectly used when applying the projectB role. This
was behaving as expected* when running from an [unknown] earlier commit of
ansible so I think it was introduced recently.

* Expected behaviour would be to use the variables from
projectB/vars/main.yml

I have ensured that manually performing a git clone and git checkout does
really work with the correct details.

Thanks in advance for any input or clarification on what I may have missed,
or if it is indeed a bug.

--
Tom Bamford

*@Planet*
ATPLANET (Pty) Ltd
atplanet.co.za

Cell: +27 (0)79-095-7112
Fax: +27 (0)86-599-1310

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscribe@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAAnNz0OHf%2Bhx7tLrmoqW6NMjJRkaRwOkk%2BX9U2%2BnTW-sce78Eg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Tom Bamford at Sep 29, 2014 at 3:16 pm
    Oh, the role name mismatch between what is in deploy.yml and the following
    filenames (deploy-projectA vs projectA) really is just a typo (doh).

    Tom
    On 29 September 2014 17:13, Tom Bamford wrote:

    Hi all

    I'm running from HEAD (recently ran 'git pull --rebase && git submodule
    update --init --recursive' following recent restructuring).

    Unfortunately I can't tell which commit I was previously running from, but
    I currently have an issue with the value of a variable being used from a
    different role.

    I have the following structure. Real repository details are substituted
    for privacy but I have been careful to preserve the alphanumerical order of
    the project names.

    *deploy.yml*

    - name: Configure instance(s) and deploy application
    hosts: launch
    user: root
    gather_facts: true

    roles:

    - role: deploy-projectB
    tags: deploy
    when: project == 'projectB' or project == 'subprojectB'

    - role: deploy-projectA
    tags: deploy
    when: project == 'projectA'

    *roles/projectB/tasks/main.yml*

    - name: what repo url and dir are we cloning?
    debug: msg="repo_url={{ repo_url }} repo_dir={{ repo_dir }}"

    - name: Git clone
    git: repo={{ repo_url }}
    dest={{ repo_dir }}
    version={{ repo_branch }}
    accept_hostkey=yes

    *roles/projectB/vars/main.yml*

    repo_url: ssh://git@github.com/myorg/projectB.git
    repo_dir: /usr/local/projectB/

    *roles/projectA/vars.yml*

    repo_url: ssh://git@github.com/myorg/projectA.git
    repo_dir: /usr/local/projectA/


    Now, when running the following: ansible-playbook -vvvv deploy.yml -e
    'project=projectB repo_branch=feature/blah'

    I get the following output and error when the projectB role is being
    applied (the error is because the origin/feature/blah branch doesn't exist
    on the projectA repo)

    TASK: [deploy-system | what is going on?]
    *************************************
    <ec2-54-183-209-28.us-west-1.compute.amazonaws.com> ESTABLISH CONNECTION
    FOR USER: root
    ok: [ec2-54-183-209-28.us-west-1.compute.amazonaws.com] => {
    "msg": "repo_branch=feature/blah repo_url=ssh://
    git@github.com/myorg/projectA.git repo_dir=/usr/local/projectA/"
    }

    TASK: [deploy-system | Git clone]
    *********************************************
    <ec2-54-183-209-28.us-west-1.compute.amazonaws.com> ESTABLISH CONNECTION
    FOR USER: root
    <ec2-54-183-209-28.us-west-1.compute.amazonaws.com> REMOTE_MODULE git
    repo=ssh:********@github.com/myorg/projectA.git dest=/usr/local/projectA/
    version=feature/blah accept_hostkey=yes
    <ec2-54-183-209-28.us-west-1.compute.amazonaws.com> EXEC ssh -C -tt -vvv
    -o ControlMaster=auto -o ControlPersist=60s -o
    ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r -o
    StrictHostKeyChecking=no -o Port=22 -o IdentityFile="/root/.ssh/id_rsa" -o
    KbdInteractiveAuthentication=no -o
    PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey
    -o PasswordAuthentication=no -o ConnectTimeout=10
    ec2-54-183-209-28.us-west-1.compute.amazonaws.com /bin/sh -c 'mkdir -p
    $HOME/.ansible/tmp/ansible-tmp-1412002786.78-203481241742422 && echo
    $HOME/.ansible/tmp/ansible-tmp-1412002786.78-203481241742422'
    <ec2-54-183-209-28.us-west-1.compute.amazonaws.com> PUT /tmp/tmpAAFWjp TO
    /root/.ansible/tmp/ansible-tmp-1412002786.78-203481241742422/git
    <ec2-54-183-209-28.us-west-1.compute.amazonaws.com> EXEC ssh -C -tt -vvv
    -o ControlMaster=auto -o ControlPersist=60s -o
    ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r -o
    StrictHostKeyChecking=no -o Port=22 -o IdentityFile="/root/.ssh/id_rsa" -o
    KbdInteractiveAuthentication=no -o
    PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey
    -o PasswordAuthentication=no -o ConnectTimeout=10
    ec2-54-183-209-28.us-west-1.compute.amazonaws.com /bin/sh -c
    'LANG=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 /usr/bin/python2
    /root/.ansible/tmp/ansible-tmp-1412002786.78-203481241742422/git; rm -rf
    /root/.ansible/tmp/ansible-tmp-1412002786.78-203481241742422/ >/dev/null
    2>&1'
    failed: [ec2-54-183-209-28.us-west-1.compute.amazonaws.com] => {"failed":
    true}
    msg: Failed to checkout feature/blah

    FATAL: all hosts have already failed -- aborting

    As you can see, the {{ repo_url }} and {{ repo_dir }} variables from
    projectA are being incorrectly used when applying the projectB role. This
    was behaving as expected* when running from an [unknown] earlier commit of
    ansible so I think it was introduced recently.

    * Expected behaviour would be to use the variables from
    projectB/vars/main.yml

    I have ensured that manually performing a git clone and git checkout does
    really work with the correct details.

    Thanks in advance for any input or clarification on what I may have
    missed, or if it is indeed a bug.

    --
    Tom Bamford

    *@Planet*
    ATPLANET (Pty) Ltd
    atplanet.co.za

    Cell: +27 (0)79-095-7112
    Fax: +27 (0)86-599-1310


    --
    Tom Bamford

    *@Planet*
    ATPLANET (Pty) Ltd
    atplanet.co.za

    Cell: +27 (0)79-095-7112
    Fax: +27 (0)86-599-1310

    --
    You received this message because you are subscribed to the Google Groups "Ansible Project" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscribe@googlegroups.com.
    To post to this group, send email to ansible-project@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAAnNz0OktaAsBjWO9UoB%3Dnkxqa4x9cus9c3imvRUNHeOxC5hgQ%40mail.gmail.com.
    For more options, visit https://groups.google.com/d/optout.
  • Tom Bamford at Sep 29, 2014 at 3:18 pm
    Sorry, also the output of `ansible --version`:

    ansible 1.8 (devel 459722899d) last updated 2014/09/29 14:22:39 (GMT +000)
       lib/ansible/modules/core: (detached HEAD db5668b84c) last updated
    2014/09/29 14:22:47 (GMT +000)
       lib/ansible/modules/extras: (detached HEAD 110250d344) last updated
    2014/09/29 14:22:52 (GMT +000)
       configured module search path = /usr/share/ansible


    On 29 September 2014 17:16, Tom Bamford wrote:

    Oh, the role name mismatch between what is in deploy.yml and the following
    filenames (deploy-projectA vs projectA) really is just a typo (doh).

    Tom
    On 29 September 2014 17:13, Tom Bamford wrote:

    Hi all

    I'm running from HEAD (recently ran 'git pull --rebase && git submodule
    update --init --recursive' following recent restructuring).

    Unfortunately I can't tell which commit I was previously running from,
    but I currently have an issue with the value of a variable being used from
    a different role.

    I have the following structure. Real repository details are substituted
    for privacy but I have been careful to preserve the alphanumerical order of
    the project names.

    *deploy.yml*

    - name: Configure instance(s) and deploy application
    hosts: launch
    user: root
    gather_facts: true

    roles:

    - role: deploy-projectB
    tags: deploy
    when: project == 'projectB' or project == 'subprojectB'

    - role: deploy-projectA
    tags: deploy
    when: project == 'projectA'

    *roles/projectB/tasks/main.yml*

    - name: what repo url and dir are we cloning?
    debug: msg="repo_url={{ repo_url }} repo_dir={{ repo_dir }}"

    - name: Git clone
    git: repo={{ repo_url }}
    dest={{ repo_dir }}
    version={{ repo_branch }}
    accept_hostkey=yes

    *roles/projectB/vars/main.yml*

    repo_url: ssh://git@github.com/myorg/projectB.git
    repo_dir: /usr/local/projectB/

    *roles/projectA/vars.yml*

    repo_url: ssh://git@github.com/myorg/projectA.git
    repo_dir: /usr/local/projectA/


    Now, when running the following: ansible-playbook -vvvv deploy.yml -e
    'project=projectB repo_branch=feature/blah'

    I get the following output and error when the projectB role is being
    applied (the error is because the origin/feature/blah branch doesn't exist
    on the projectA repo)

    TASK: [deploy-system | what is going on?]
    *************************************
    <ec2-54-183-209-28.us-west-1.compute.amazonaws.com> ESTABLISH CONNECTION
    FOR USER: root
    ok: [ec2-54-183-209-28.us-west-1.compute.amazonaws.com] => {
    "msg": "repo_branch=feature/blah repo_url=ssh://
    git@github.com/myorg/projectA.git repo_dir=/usr/local/projectA/"
    }

    TASK: [deploy-system | Git clone]
    *********************************************
    <ec2-54-183-209-28.us-west-1.compute.amazonaws.com> ESTABLISH CONNECTION
    FOR USER: root
    <ec2-54-183-209-28.us-west-1.compute.amazonaws.com> REMOTE_MODULE git
    repo=ssh:********@github.com/myorg/projectA.git
    dest=/usr/local/projectA/ version=feature/blah accept_hostkey=yes
    <ec2-54-183-209-28.us-west-1.compute.amazonaws.com> EXEC ssh -C -tt -vvv
    -o ControlMaster=auto -o ControlPersist=60s -o
    ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r -o
    StrictHostKeyChecking=no -o Port=22 -o IdentityFile="/root/.ssh/id_rsa" -o
    KbdInteractiveAuthentication=no -o
    PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey
    -o PasswordAuthentication=no -o ConnectTimeout=10
    ec2-54-183-209-28.us-west-1.compute.amazonaws.com /bin/sh -c 'mkdir -p
    $HOME/.ansible/tmp/ansible-tmp-1412002786.78-203481241742422 && echo
    $HOME/.ansible/tmp/ansible-tmp-1412002786.78-203481241742422'
    <ec2-54-183-209-28.us-west-1.compute.amazonaws.com> PUT /tmp/tmpAAFWjp
    TO /root/.ansible/tmp/ansible-tmp-1412002786.78-203481241742422/git
    <ec2-54-183-209-28.us-west-1.compute.amazonaws.com> EXEC ssh -C -tt -vvv
    -o ControlMaster=auto -o ControlPersist=60s -o
    ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r -o
    StrictHostKeyChecking=no -o Port=22 -o IdentityFile="/root/.ssh/id_rsa" -o
    KbdInteractiveAuthentication=no -o
    PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey
    -o PasswordAuthentication=no -o ConnectTimeout=10
    ec2-54-183-209-28.us-west-1.compute.amazonaws.com /bin/sh -c
    'LANG=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 /usr/bin/python2
    /root/.ansible/tmp/ansible-tmp-1412002786.78-203481241742422/git; rm -rf
    /root/.ansible/tmp/ansible-tmp-1412002786.78-203481241742422/ >/dev/null
    2>&1'
    failed: [ec2-54-183-209-28.us-west-1.compute.amazonaws.com] =>
    {"failed": true}
    msg: Failed to checkout feature/blah

    FATAL: all hosts have already failed -- aborting

    As you can see, the {{ repo_url }} and {{ repo_dir }} variables from
    projectA are being incorrectly used when applying the projectB role. This
    was behaving as expected* when running from an [unknown] earlier commit of
    ansible so I think it was introduced recently.

    * Expected behaviour would be to use the variables from
    projectB/vars/main.yml

    I have ensured that manually performing a git clone and git checkout does
    really work with the correct details.

    Thanks in advance for any input or clarification on what I may have
    missed, or if it is indeed a bug.

    --
    Tom Bamford

    *@Planet*
    ATPLANET (Pty) Ltd
    atplanet.co.za

    Cell: +27 (0)79-095-7112
    Fax: +27 (0)86-599-1310


    --
    Tom Bamford

    *@Planet*
    ATPLANET (Pty) Ltd
    atplanet.co.za

    Cell: +27 (0)79-095-7112
    Fax: +27 (0)86-599-1310


    --
    Tom Bamford

    *@Planet*
    ATPLANET (Pty) Ltd
    atplanet.co.za

    Cell: +27 (0)79-095-7112
    Fax: +27 (0)86-599-1310

    --
    You received this message because you are subscribed to the Google Groups "Ansible Project" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscribe@googlegroups.com.
    To post to this group, send email to ansible-project@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAAnNz0PZEM8oDz0GfKUcDKnrPTpi5VRGbvxAPF_gwxtiQVQD7Q%40mail.gmail.com.
    For more options, visit https://groups.google.com/d/optout.
  • Ben Symonds at Sep 30, 2014 at 9:05 am
    I have seen this too. I haven't had time to investigate it yet (I just
    reverted back to 1.7 in the meantime). Happy to provide more details of my
    config (although it is similar - two roles with vars, role A picking up
    vars from role B). I just wanted to reply to the list confirming it's not
    just Tom who's seeing it!

    I suppose it might be worth opening a Github issue for it. It does sound
    like a recently-introduced bug.
    On 29 September 2014 16:17, Tom Bamford wrote:

    Sorry, also the output of `ansible --version`:

    ansible 1.8 (devel 459722899d) last updated 2014/09/29 14:22:39 (GMT +000)
    lib/ansible/modules/core: (detached HEAD db5668b84c) last updated
    2014/09/29 14:22:47 (GMT +000)
    lib/ansible/modules/extras: (detached HEAD 110250d344) last updated
    2014/09/29 14:22:52 (GMT +000)
    configured module search path = /usr/share/ansible


    On 29 September 2014 17:16, Tom Bamford wrote:

    Oh, the role name mismatch between what is in deploy.yml and the
    following filenames (deploy-projectA vs projectA) really is just a typo
    (doh).

    Tom
    On 29 September 2014 17:13, Tom Bamford wrote:

    Hi all

    I'm running from HEAD (recently ran 'git pull --rebase && git submodule
    update --init --recursive' following recent restructuring).

    Unfortunately I can't tell which commit I was previously running from,
    but I currently have an issue with the value of a variable being used from
    a different role.

    I have the following structure. Real repository details are substituted
    for privacy but I have been careful to preserve the alphanumerical order of
    the project names.

    *deploy.yml*

    - name: Configure instance(s) and deploy application
    hosts: launch
    user: root
    gather_facts: true

    roles:

    - role: deploy-projectB
    tags: deploy
    when: project == 'projectB' or project == 'subprojectB'

    - role: deploy-projectA
    tags: deploy
    when: project == 'projectA'

    *roles/projectB/tasks/main.yml*

    - name: what repo url and dir are we cloning?
    debug: msg="repo_url={{ repo_url }} repo_dir={{ repo_dir }}"

    - name: Git clone
    git: repo={{ repo_url }}
    dest={{ repo_dir }}
    version={{ repo_branch }}
    accept_hostkey=yes

    *roles/projectB/vars/main.yml*

    repo_url: ssh://git@github.com/myorg/projectB.git
    repo_dir: /usr/local/projectB/

    *roles/projectA/vars.yml*

    repo_url: ssh://git@github.com/myorg/projectA.git
    repo_dir: /usr/local/projectA/


    Now, when running the following: ansible-playbook -vvvv deploy.yml -e
    'project=projectB repo_branch=feature/blah'

    I get the following output and error when the projectB role is being
    applied (the error is because the origin/feature/blah branch doesn't exist
    on the projectA repo)

    TASK: [deploy-system | what is going on?]
    *************************************
    <ec2-54-183-209-28.us-west-1.compute.amazonaws.com> ESTABLISH
    CONNECTION FOR USER: root
    ok: [ec2-54-183-209-28.us-west-1.compute.amazonaws.com] => {
    "msg": "repo_branch=feature/blah repo_url=ssh://
    git@github.com/myorg/projectA.git repo_dir=/usr/local/projectA/"
    }

    TASK: [deploy-system | Git clone]
    *********************************************
    <ec2-54-183-209-28.us-west-1.compute.amazonaws.com> ESTABLISH
    CONNECTION FOR USER: root
    <ec2-54-183-209-28.us-west-1.compute.amazonaws.com> REMOTE_MODULE git
    repo=ssh:********@github.com/myorg/projectA.git
    dest=/usr/local/projectA/ version=feature/blah accept_hostkey=yes
    <ec2-54-183-209-28.us-west-1.compute.amazonaws.com> EXEC ssh -C -tt
    -vvv -o ControlMaster=auto -o ControlPersist=60s -o
    ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r -o
    StrictHostKeyChecking=no -o Port=22 -o IdentityFile="/root/.ssh/id_rsa" -o
    KbdInteractiveAuthentication=no -o
    PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey
    -o PasswordAuthentication=no -o ConnectTimeout=10
    ec2-54-183-209-28.us-west-1.compute.amazonaws.com /bin/sh -c 'mkdir -p
    $HOME/.ansible/tmp/ansible-tmp-1412002786.78-203481241742422 && echo
    $HOME/.ansible/tmp/ansible-tmp-1412002786.78-203481241742422'
    <ec2-54-183-209-28.us-west-1.compute.amazonaws.com> PUT /tmp/tmpAAFWjp
    TO /root/.ansible/tmp/ansible-tmp-1412002786.78-203481241742422/git
    <ec2-54-183-209-28.us-west-1.compute.amazonaws.com> EXEC ssh -C -tt
    -vvv -o ControlMaster=auto -o ControlPersist=60s -o
    ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r -o
    StrictHostKeyChecking=no -o Port=22 -o IdentityFile="/root/.ssh/id_rsa" -o
    KbdInteractiveAuthentication=no -o
    PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey
    -o PasswordAuthentication=no -o ConnectTimeout=10
    ec2-54-183-209-28.us-west-1.compute.amazonaws.com /bin/sh -c
    'LANG=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 /usr/bin/python2
    /root/.ansible/tmp/ansible-tmp-1412002786.78-203481241742422/git; rm -rf
    /root/.ansible/tmp/ansible-tmp-1412002786.78-203481241742422/ >/dev/null
    2>&1'
    failed: [ec2-54-183-209-28.us-west-1.compute.amazonaws.com] =>
    {"failed": true}
    msg: Failed to checkout feature/blah

    FATAL: all hosts have already failed -- aborting

    As you can see, the {{ repo_url }} and {{ repo_dir }} variables from
    projectA are being incorrectly used when applying the projectB role. This
    was behaving as expected* when running from an [unknown] earlier commit of
    ansible so I think it was introduced recently.

    * Expected behaviour would be to use the variables from
    projectB/vars/main.yml

    I have ensured that manually performing a git clone and git checkout
    does really work with the correct details.

    Thanks in advance for any input or clarification on what I may have
    missed, or if it is indeed a bug.

    --
    Tom Bamford

    *@Planet*
    ATPLANET (Pty) Ltd
    atplanet.co.za

    Cell: +27 (0)79-095-7112
    Fax: +27 (0)86-599-1310


    --
    Tom Bamford

    *@Planet*
    ATPLANET (Pty) Ltd
    atplanet.co.za

    Cell: +27 (0)79-095-7112
    Fax: +27 (0)86-599-1310


    --
    Tom Bamford

    *@Planet*
    ATPLANET (Pty) Ltd
    atplanet.co.za

    Cell: +27 (0)79-095-7112
    Fax: +27 (0)86-599-1310

    --
    You received this message because you are subscribed to the Google Groups
    "Ansible Project" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to ansible-project+unsubscribe@googlegroups.com.
    To post to this group, send email to ansible-project@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/ansible-project/CAAnNz0PZEM8oDz0GfKUcDKnrPTpi5VRGbvxAPF_gwxtiQVQD7Q%40mail.gmail.com
    <https://groups.google.com/d/msgid/ansible-project/CAAnNz0PZEM8oDz0GfKUcDKnrPTpi5VRGbvxAPF_gwxtiQVQD7Q%40mail.gmail.com?utm_medium=email&utm_source=footer>
    .

    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "Ansible Project" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscribe@googlegroups.com.
    To post to this group, send email to ansible-project@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CADVA9h9%3DLWirqtuoSRM%3DL%3D8cGyBhk1%2BmnjLE_-vJPSjMyQLkgw%40mail.gmail.com.
    For more options, visit https://groups.google.com/d/optout.
  • James Cammarata at Sep 30, 2014 at 5:12 pm
    Hi, I believe this issue is the same one as discussed above:

    https://github.com/ansible/ansible/issues/9219

    Please see my comment at the bottom regarding a new feature branch I've
    been working on, which resolves the example playbook in that issue.
    Additional testing on that new branch would be very welcome!

    Thanks!
    On Tue, Sep 30, 2014 at 4:05 AM, Ben Symonds wrote:

    I have seen this too. I haven't had time to investigate it yet (I just
    reverted back to 1.7 in the meantime). Happy to provide more details of my
    config (although it is similar - two roles with vars, role A picking up
    vars from role B). I just wanted to reply to the list confirming it's not
    just Tom who's seeing it!

    I suppose it might be worth opening a Github issue for it. It does sound
    like a recently-introduced bug.
    On 29 September 2014 16:17, Tom Bamford wrote:

    Sorry, also the output of `ansible --version`:

    ansible 1.8 (devel 459722899d) last updated 2014/09/29 14:22:39 (GMT +000)
    lib/ansible/modules/core: (detached HEAD db5668b84c) last updated
    2014/09/29 14:22:47 (GMT +000)
    lib/ansible/modules/extras: (detached HEAD 110250d344) last updated
    2014/09/29 14:22:52 (GMT +000)
    configured module search path = /usr/share/ansible


    On 29 September 2014 17:16, Tom Bamford wrote:

    Oh, the role name mismatch between what is in deploy.yml and the
    following filenames (deploy-projectA vs projectA) really is just a typo
    (doh).

    Tom
    On 29 September 2014 17:13, Tom Bamford wrote:

    Hi all

    I'm running from HEAD (recently ran 'git pull --rebase && git
    submodule update --init --recursive' following recent restructuring).

    Unfortunately I can't tell which commit I was previously running from,
    but I currently have an issue with the value of a variable being used from
    a different role.

    I have the following structure. Real repository details are substituted
    for privacy but I have been careful to preserve the alphanumerical order of
    the project names.

    *deploy.yml*

    - name: Configure instance(s) and deploy application
    hosts: launch
    user: root
    gather_facts: true

    roles:

    - role: deploy-projectB
    tags: deploy
    when: project == 'projectB' or project == 'subprojectB'

    - role: deploy-projectA
    tags: deploy
    when: project == 'projectA'

    *roles/projectB/tasks/main.yml*

    - name: what repo url and dir are we cloning?
    debug: msg="repo_url={{ repo_url }} repo_dir={{ repo_dir }}"

    - name: Git clone
    git: repo={{ repo_url }}
    dest={{ repo_dir }}
    version={{ repo_branch }}
    accept_hostkey=yes

    *roles/projectB/vars/main.yml*

    repo_url: ssh://git@github.com/myorg/projectB.git
    repo_dir: /usr/local/projectB/

    *roles/projectA/vars.yml*

    repo_url: ssh://git@github.com/myorg/projectA.git
    repo_dir: /usr/local/projectA/


    Now, when running the following: ansible-playbook -vvvv deploy.yml -e
    'project=projectB repo_branch=feature/blah'

    I get the following output and error when the projectB role is being
    applied (the error is because the origin/feature/blah branch doesn't exist
    on the projectA repo)

    TASK: [deploy-system | what is going on?]
    *************************************
    <ec2-54-183-209-28.us-west-1.compute.amazonaws.com> ESTABLISH
    CONNECTION FOR USER: root
    ok: [ec2-54-183-209-28.us-west-1.compute.amazonaws.com] => {
    "msg": "repo_branch=feature/blah repo_url=ssh://
    git@github.com/myorg/projectA.git repo_dir=/usr/local/projectA/"
    }

    TASK: [deploy-system | Git clone]
    *********************************************
    <ec2-54-183-209-28.us-west-1.compute.amazonaws.com> ESTABLISH
    CONNECTION FOR USER: root
    <ec2-54-183-209-28.us-west-1.compute.amazonaws.com> REMOTE_MODULE git
    repo=ssh:********@github.com/myorg/projectA.git
    dest=/usr/local/projectA/ version=feature/blah accept_hostkey=yes
    <ec2-54-183-209-28.us-west-1.compute.amazonaws.com> EXEC ssh -C -tt
    -vvv -o ControlMaster=auto -o ControlPersist=60s -o
    ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r -o
    StrictHostKeyChecking=no -o Port=22 -o IdentityFile="/root/.ssh/id_rsa" -o
    KbdInteractiveAuthentication=no -o
    PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey
    -o PasswordAuthentication=no -o ConnectTimeout=10
    ec2-54-183-209-28.us-west-1.compute.amazonaws.com /bin/sh -c 'mkdir -p
    $HOME/.ansible/tmp/ansible-tmp-1412002786.78-203481241742422 && echo
    $HOME/.ansible/tmp/ansible-tmp-1412002786.78-203481241742422'
    <ec2-54-183-209-28.us-west-1.compute.amazonaws.com> PUT /tmp/tmpAAFWjp
    TO /root/.ansible/tmp/ansible-tmp-1412002786.78-203481241742422/git
    <ec2-54-183-209-28.us-west-1.compute.amazonaws.com> EXEC ssh -C -tt
    -vvv -o ControlMaster=auto -o ControlPersist=60s -o
    ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r -o
    StrictHostKeyChecking=no -o Port=22 -o IdentityFile="/root/.ssh/id_rsa" -o
    KbdInteractiveAuthentication=no -o
    PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey
    -o PasswordAuthentication=no -o ConnectTimeout=10
    ec2-54-183-209-28.us-west-1.compute.amazonaws.com /bin/sh -c
    'LANG=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 /usr/bin/python2
    /root/.ansible/tmp/ansible-tmp-1412002786.78-203481241742422/git; rm -rf
    /root/.ansible/tmp/ansible-tmp-1412002786.78-203481241742422/ >/dev/null
    2>&1'
    failed: [ec2-54-183-209-28.us-west-1.compute.amazonaws.com] =>
    {"failed": true}
    msg: Failed to checkout feature/blah

    FATAL: all hosts have already failed -- aborting

    As you can see, the {{ repo_url }} and {{ repo_dir }} variables from
    projectA are being incorrectly used when applying the projectB role. This
    was behaving as expected* when running from an [unknown] earlier commit of
    ansible so I think it was introduced recently.

    * Expected behaviour would be to use the variables from
    projectB/vars/main.yml

    I have ensured that manually performing a git clone and git checkout
    does really work with the correct details.

    Thanks in advance for any input or clarification on what I may have
    missed, or if it is indeed a bug.

    --
    Tom Bamford

    *@Planet*
    ATPLANET (Pty) Ltd
    atplanet.co.za

    Cell: +27 (0)79-095-7112
    Fax: +27 (0)86-599-1310


    --
    Tom Bamford

    *@Planet*
    ATPLANET (Pty) Ltd
    atplanet.co.za

    Cell: +27 (0)79-095-7112
    Fax: +27 (0)86-599-1310


    --
    Tom Bamford

    *@Planet*
    ATPLANET (Pty) Ltd
    atplanet.co.za

    Cell: +27 (0)79-095-7112
    Fax: +27 (0)86-599-1310

    --
    You received this message because you are subscribed to the Google Groups
    "Ansible Project" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to ansible-project+unsubscribe@googlegroups.com.
    To post to this group, send email to ansible-project@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/ansible-project/CAAnNz0PZEM8oDz0GfKUcDKnrPTpi5VRGbvxAPF_gwxtiQVQD7Q%40mail.gmail.com
    <https://groups.google.com/d/msgid/ansible-project/CAAnNz0PZEM8oDz0GfKUcDKnrPTpi5VRGbvxAPF_gwxtiQVQD7Q%40mail.gmail.com?utm_medium=email&utm_source=footer>
    .

    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups
    "Ansible Project" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to ansible-project+unsubscribe@googlegroups.com.
    To post to this group, send email to ansible-project@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/ansible-project/CADVA9h9%3DLWirqtuoSRM%3DL%3D8cGyBhk1%2BmnjLE_-vJPSjMyQLkgw%40mail.gmail.com
    <https://groups.google.com/d/msgid/ansible-project/CADVA9h9%3DLWirqtuoSRM%3DL%3D8cGyBhk1%2BmnjLE_-vJPSjMyQLkgw%40mail.gmail.com?utm_medium=email&utm_source=footer>
    .

    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "Ansible Project" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscribe@googlegroups.com.
    To post to this group, send email to ansible-project@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAMFyvFjCRDbiL_hQv%3D-Z_nw6aS99P1203U_hDhTnAiLPrNENQQ%40mail.gmail.com.
    For more options, visit https://groups.google.com/d/optout.
  • Michael DeHaan at Sep 30, 2014 at 7:22 pm
    Role protections, such that variables defined in a role are assuredly used
    in that role, are a major part of the "great role standdown of 2013".

    We need to fix this ahead of the feature branch, as (A) that feature branch
    might not hit 1.8, and (B) we need to preserve that role compatibility now.


    On Tue, Sep 30, 2014 at 1:12 PM, James Cammarata wrote:

    Hi, I believe this issue is the same one as discussed above:

    https://github.com/ansible/ansible/issues/9219

    Please see my comment at the bottom regarding a new feature branch I've
    been working on, which resolves the example playbook in that issue.
    Additional testing on that new branch would be very welcome!

    Thanks!
    On Tue, Sep 30, 2014 at 4:05 AM, Ben Symonds wrote:

    I have seen this too. I haven't had time to investigate it yet (I just
    reverted back to 1.7 in the meantime). Happy to provide more details of my
    config (although it is similar - two roles with vars, role A picking up
    vars from role B). I just wanted to reply to the list confirming it's not
    just Tom who's seeing it!

    I suppose it might be worth opening a Github issue for it. It does sound
    like a recently-introduced bug.
    On 29 September 2014 16:17, Tom Bamford wrote:

    Sorry, also the output of `ansible --version`:

    ansible 1.8 (devel 459722899d) last updated 2014/09/29 14:22:39 (GMT
    +000)
    lib/ansible/modules/core: (detached HEAD db5668b84c) last updated
    2014/09/29 14:22:47 (GMT +000)
    lib/ansible/modules/extras: (detached HEAD 110250d344) last updated
    2014/09/29 14:22:52 (GMT +000)
    configured module search path = /usr/share/ansible


    On 29 September 2014 17:16, Tom Bamford wrote:

    Oh, the role name mismatch between what is in deploy.yml and the
    following filenames (deploy-projectA vs projectA) really is just a typo
    (doh).

    Tom
    On 29 September 2014 17:13, Tom Bamford wrote:

    Hi all

    I'm running from HEAD (recently ran 'git pull --rebase && git
    submodule update --init --recursive' following recent restructuring).

    Unfortunately I can't tell which commit I was previously running from,
    but I currently have an issue with the value of a variable being used from
    a different role.

    I have the following structure. Real repository details are
    substituted for privacy but I have been careful to preserve the
    alphanumerical order of the project names.

    *deploy.yml*

    - name: Configure instance(s) and deploy application
    hosts: launch
    user: root
    gather_facts: true

    roles:

    - role: deploy-projectB
    tags: deploy
    when: project == 'projectB' or project == 'subprojectB'

    - role: deploy-projectA
    tags: deploy
    when: project == 'projectA'

    *roles/projectB/tasks/main.yml*

    - name: what repo url and dir are we cloning?
    debug: msg="repo_url={{ repo_url }} repo_dir={{ repo_dir }}"

    - name: Git clone
    git: repo={{ repo_url }}
    dest={{ repo_dir }}
    version={{ repo_branch }}
    accept_hostkey=yes

    *roles/projectB/vars/main.yml*

    repo_url: ssh://git@github.com/myorg/projectB.git
    repo_dir: /usr/local/projectB/

    *roles/projectA/vars.yml*

    repo_url: ssh://git@github.com/myorg/projectA.git
    repo_dir: /usr/local/projectA/


    Now, when running the following: ansible-playbook -vvvv deploy.yml -e
    'project=projectB repo_branch=feature/blah'

    I get the following output and error when the projectB role is being
    applied (the error is because the origin/feature/blah branch doesn't exist
    on the projectA repo)

    TASK: [deploy-system | what is going on?]
    *************************************
    <ec2-54-183-209-28.us-west-1.compute.amazonaws.com> ESTABLISH
    CONNECTION FOR USER: root
    ok: [ec2-54-183-209-28.us-west-1.compute.amazonaws.com] => {
    "msg": "repo_branch=feature/blah repo_url=ssh://
    git@github.com/myorg/projectA.git repo_dir=/usr/local/projectA/"
    }

    TASK: [deploy-system | Git clone]
    *********************************************
    <ec2-54-183-209-28.us-west-1.compute.amazonaws.com> ESTABLISH
    CONNECTION FOR USER: root
    <ec2-54-183-209-28.us-west-1.compute.amazonaws.com> REMOTE_MODULE git
    repo=ssh:********@github.com/myorg/projectA.git
    dest=/usr/local/projectA/ version=feature/blah accept_hostkey=yes
    <ec2-54-183-209-28.us-west-1.compute.amazonaws.com> EXEC ssh -C -tt
    -vvv -o ControlMaster=auto -o ControlPersist=60s -o
    ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r -o
    StrictHostKeyChecking=no -o Port=22 -o IdentityFile="/root/.ssh/id_rsa" -o
    KbdInteractiveAuthentication=no -o
    PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey
    -o PasswordAuthentication=no -o ConnectTimeout=10
    ec2-54-183-209-28.us-west-1.compute.amazonaws.com /bin/sh -c 'mkdir
    -p $HOME/.ansible/tmp/ansible-tmp-1412002786.78-203481241742422 && echo
    $HOME/.ansible/tmp/ansible-tmp-1412002786.78-203481241742422'
    <ec2-54-183-209-28.us-west-1.compute.amazonaws.com> PUT
    /tmp/tmpAAFWjp TO
    /root/.ansible/tmp/ansible-tmp-1412002786.78-203481241742422/git
    <ec2-54-183-209-28.us-west-1.compute.amazonaws.com> EXEC ssh -C -tt
    -vvv -o ControlMaster=auto -o ControlPersist=60s -o
    ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r -o
    StrictHostKeyChecking=no -o Port=22 -o IdentityFile="/root/.ssh/id_rsa" -o
    KbdInteractiveAuthentication=no -o
    PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey
    -o PasswordAuthentication=no -o ConnectTimeout=10
    ec2-54-183-209-28.us-west-1.compute.amazonaws.com /bin/sh -c
    'LANG=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 /usr/bin/python2
    /root/.ansible/tmp/ansible-tmp-1412002786.78-203481241742422/git; rm -rf
    /root/.ansible/tmp/ansible-tmp-1412002786.78-203481241742422/ >/dev/null
    2>&1'
    failed: [ec2-54-183-209-28.us-west-1.compute.amazonaws.com] =>
    {"failed": true}
    msg: Failed to checkout feature/blah

    FATAL: all hosts have already failed -- aborting

    As you can see, the {{ repo_url }} and {{ repo_dir }} variables from
    projectA are being incorrectly used when applying the projectB role. This
    was behaving as expected* when running from an [unknown] earlier commit of
    ansible so I think it was introduced recently.

    * Expected behaviour would be to use the variables from
    projectB/vars/main.yml

    I have ensured that manually performing a git clone and git checkout
    does really work with the correct details.

    Thanks in advance for any input or clarification on what I may have
    missed, or if it is indeed a bug.

    --
    Tom Bamford

    *@Planet*
    ATPLANET (Pty) Ltd
    atplanet.co.za

    Cell: +27 (0)79-095-7112
    Fax: +27 (0)86-599-1310


    --
    Tom Bamford

    *@Planet*
    ATPLANET (Pty) Ltd
    atplanet.co.za

    Cell: +27 (0)79-095-7112
    Fax: +27 (0)86-599-1310


    --
    Tom Bamford

    *@Planet*
    ATPLANET (Pty) Ltd
    atplanet.co.za

    Cell: +27 (0)79-095-7112
    Fax: +27 (0)86-599-1310

    --
    You received this message because you are subscribed to the Google
    Groups "Ansible Project" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to ansible-project+unsubscribe@googlegroups.com.
    To post to this group, send email to ansible-project@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/ansible-project/CAAnNz0PZEM8oDz0GfKUcDKnrPTpi5VRGbvxAPF_gwxtiQVQD7Q%40mail.gmail.com
    <https://groups.google.com/d/msgid/ansible-project/CAAnNz0PZEM8oDz0GfKUcDKnrPTpi5VRGbvxAPF_gwxtiQVQD7Q%40mail.gmail.com?utm_medium=email&utm_source=footer>
    .

    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups
    "Ansible Project" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to ansible-project+unsubscribe@googlegroups.com.
    To post to this group, send email to ansible-project@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/ansible-project/CADVA9h9%3DLWirqtuoSRM%3DL%3D8cGyBhk1%2BmnjLE_-vJPSjMyQLkgw%40mail.gmail.com
    <https://groups.google.com/d/msgid/ansible-project/CADVA9h9%3DLWirqtuoSRM%3DL%3D8cGyBhk1%2BmnjLE_-vJPSjMyQLkgw%40mail.gmail.com?utm_medium=email&utm_source=footer>
    .

    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups
    "Ansible Project" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to ansible-project+unsubscribe@googlegroups.com.
    To post to this group, send email to ansible-project@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/ansible-project/CAMFyvFjCRDbiL_hQv%3D-Z_nw6aS99P1203U_hDhTnAiLPrNENQQ%40mail.gmail.com
    <https://groups.google.com/d/msgid/ansible-project/CAMFyvFjCRDbiL_hQv%3D-Z_nw6aS99P1203U_hDhTnAiLPrNENQQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
    .

    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "Ansible Project" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscribe@googlegroups.com.
    To post to this group, send email to ansible-project@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgz5GqkAnEqjhTBzZdBUpzT%3D5%3DEKNd%2Bgd-ZtLZxk8Fas1w%40mail.gmail.com.
    For more options, visit https://groups.google.com/d/optout.
  • James Cammarata at Sep 30, 2014 at 8:54 pm
    Hi Tom/Ben, we went ahead and resolved this issue by back-porting some of
    the code from that feature branch into devel for the time-being, as we're
    not ready to merge that feature branch in. If you refresh your development
    branches, you should get the new code.

    Please let us know if you continue seeing any issues related to this.

    Thanks!

    On Tue, Sep 30, 2014 at 2:22 PM, Michael DeHaan wrote:

    Role protections, such that variables defined in a role are assuredly used
    in that role, are a major part of the "great role standdown of 2013".

    We need to fix this ahead of the feature branch, as (A) that feature
    branch might not hit 1.8, and (B) we need to preserve that role
    compatibility now.


    On Tue, Sep 30, 2014 at 1:12 PM, James Cammarata wrote:

    Hi, I believe this issue is the same one as discussed above:

    https://github.com/ansible/ansible/issues/9219

    Please see my comment at the bottom regarding a new feature branch I've
    been working on, which resolves the example playbook in that issue.
    Additional testing on that new branch would be very welcome!

    Thanks!
    On Tue, Sep 30, 2014 at 4:05 AM, Ben Symonds wrote:

    I have seen this too. I haven't had time to investigate it yet (I just
    reverted back to 1.7 in the meantime). Happy to provide more details of my
    config (although it is similar - two roles with vars, role A picking up
    vars from role B). I just wanted to reply to the list confirming it's not
    just Tom who's seeing it!

    I suppose it might be worth opening a Github issue for it. It does sound
    like a recently-introduced bug.
    On 29 September 2014 16:17, Tom Bamford wrote:

    Sorry, also the output of `ansible --version`:

    ansible 1.8 (devel 459722899d) last updated 2014/09/29 14:22:39 (GMT
    +000)
    lib/ansible/modules/core: (detached HEAD db5668b84c) last updated
    2014/09/29 14:22:47 (GMT +000)
    lib/ansible/modules/extras: (detached HEAD 110250d344) last updated
    2014/09/29 14:22:52 (GMT +000)
    configured module search path = /usr/share/ansible


    On 29 September 2014 17:16, Tom Bamford wrote:

    Oh, the role name mismatch between what is in deploy.yml and the
    following filenames (deploy-projectA vs projectA) really is just a typo
    (doh).

    Tom
    On 29 September 2014 17:13, Tom Bamford wrote:

    Hi all

    I'm running from HEAD (recently ran 'git pull --rebase && git
    submodule update --init --recursive' following recent restructuring).

    Unfortunately I can't tell which commit I was previously running
    from, but I currently have an issue with the value of a variable being used
    from a different role.

    I have the following structure. Real repository details are
    substituted for privacy but I have been careful to preserve the
    alphanumerical order of the project names.

    *deploy.yml*

    - name: Configure instance(s) and deploy application
    hosts: launch
    user: root
    gather_facts: true

    roles:

    - role: deploy-projectB
    tags: deploy
    when: project == 'projectB' or project == 'subprojectB'

    - role: deploy-projectA
    tags: deploy
    when: project == 'projectA'

    *roles/projectB/tasks/main.yml*

    - name: what repo url and dir are we cloning?
    debug: msg="repo_url={{ repo_url }} repo_dir={{ repo_dir }}"

    - name: Git clone
    git: repo={{ repo_url }}
    dest={{ repo_dir }}
    version={{ repo_branch }}
    accept_hostkey=yes

    *roles/projectB/vars/main.yml*

    repo_url: ssh://git@github.com/myorg/projectB.git
    repo_dir: /usr/local/projectB/

    *roles/projectA/vars.yml*

    repo_url: ssh://git@github.com/myorg/projectA.git
    repo_dir: /usr/local/projectA/


    Now, when running the following: ansible-playbook -vvvv deploy.yml
    -e 'project=projectB repo_branch=feature/blah'

    I get the following output and error when the projectB role is being
    applied (the error is because the origin/feature/blah branch doesn't exist
    on the projectA repo)

    TASK: [deploy-system | what is going on?]
    *************************************
    <ec2-54-183-209-28.us-west-1.compute.amazonaws.com> ESTABLISH
    CONNECTION FOR USER: root
    ok: [ec2-54-183-209-28.us-west-1.compute.amazonaws.com] => {
    "msg": "repo_branch=feature/blah repo_url=ssh://
    git@github.com/myorg/projectA.git repo_dir=/usr/local/projectA/"
    }

    TASK: [deploy-system | Git clone]
    *********************************************
    <ec2-54-183-209-28.us-west-1.compute.amazonaws.com> ESTABLISH
    CONNECTION FOR USER: root
    <ec2-54-183-209-28.us-west-1.compute.amazonaws.com> REMOTE_MODULE
    git repo=ssh:********@github.com/myorg/projectA.git
    dest=/usr/local/projectA/ version=feature/blah accept_hostkey=yes
    <ec2-54-183-209-28.us-west-1.compute.amazonaws.com> EXEC ssh -C -tt
    -vvv -o ControlMaster=auto -o ControlPersist=60s -o
    ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r -o
    StrictHostKeyChecking=no -o Port=22 -o IdentityFile="/root/.ssh/id_rsa" -o
    KbdInteractiveAuthentication=no -o
    PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey
    -o PasswordAuthentication=no -o ConnectTimeout=10
    ec2-54-183-209-28.us-west-1.compute.amazonaws.com /bin/sh -c 'mkdir
    -p $HOME/.ansible/tmp/ansible-tmp-1412002786.78-203481241742422 && echo
    $HOME/.ansible/tmp/ansible-tmp-1412002786.78-203481241742422'
    <ec2-54-183-209-28.us-west-1.compute.amazonaws.com> PUT
    /tmp/tmpAAFWjp TO
    /root/.ansible/tmp/ansible-tmp-1412002786.78-203481241742422/git
    <ec2-54-183-209-28.us-west-1.compute.amazonaws.com> EXEC ssh -C -tt
    -vvv -o ControlMaster=auto -o ControlPersist=60s -o
    ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r -o
    StrictHostKeyChecking=no -o Port=22 -o IdentityFile="/root/.ssh/id_rsa" -o
    KbdInteractiveAuthentication=no -o
    PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey
    -o PasswordAuthentication=no -o ConnectTimeout=10
    ec2-54-183-209-28.us-west-1.compute.amazonaws.com /bin/sh -c
    'LANG=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 /usr/bin/python2
    /root/.ansible/tmp/ansible-tmp-1412002786.78-203481241742422/git; rm -rf
    /root/.ansible/tmp/ansible-tmp-1412002786.78-203481241742422/ >/dev/null
    2>&1'
    failed: [ec2-54-183-209-28.us-west-1.compute.amazonaws.com] =>
    {"failed": true}
    msg: Failed to checkout feature/blah

    FATAL: all hosts have already failed -- aborting

    As you can see, the {{ repo_url }} and {{ repo_dir }} variables from
    projectA are being incorrectly used when applying the projectB role. This
    was behaving as expected* when running from an [unknown] earlier commit of
    ansible so I think it was introduced recently.

    * Expected behaviour would be to use the variables from
    projectB/vars/main.yml

    I have ensured that manually performing a git clone and git checkout
    does really work with the correct details.

    Thanks in advance for any input or clarification on what I may have
    missed, or if it is indeed a bug.

    --
    Tom Bamford

    *@Planet*
    ATPLANET (Pty) Ltd
    atplanet.co.za

    Cell: +27 (0)79-095-7112
    Fax: +27 (0)86-599-1310


    --
    Tom Bamford

    *@Planet*
    ATPLANET (Pty) Ltd
    atplanet.co.za

    Cell: +27 (0)79-095-7112
    Fax: +27 (0)86-599-1310


    --
    Tom Bamford

    *@Planet*
    ATPLANET (Pty) Ltd
    atplanet.co.za

    Cell: +27 (0)79-095-7112
    Fax: +27 (0)86-599-1310

    --
    You received this message because you are subscribed to the Google
    Groups "Ansible Project" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to ansible-project+unsubscribe@googlegroups.com.
    To post to this group, send email to ansible-project@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/ansible-project/CAAnNz0PZEM8oDz0GfKUcDKnrPTpi5VRGbvxAPF_gwxtiQVQD7Q%40mail.gmail.com
    <https://groups.google.com/d/msgid/ansible-project/CAAnNz0PZEM8oDz0GfKUcDKnrPTpi5VRGbvxAPF_gwxtiQVQD7Q%40mail.gmail.com?utm_medium=email&utm_source=footer>
    .

    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google
    Groups "Ansible Project" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to ansible-project+unsubscribe@googlegroups.com.
    To post to this group, send email to ansible-project@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/ansible-project/CADVA9h9%3DLWirqtuoSRM%3DL%3D8cGyBhk1%2BmnjLE_-vJPSjMyQLkgw%40mail.gmail.com
    <https://groups.google.com/d/msgid/ansible-project/CADVA9h9%3DLWirqtuoSRM%3DL%3D8cGyBhk1%2BmnjLE_-vJPSjMyQLkgw%40mail.gmail.com?utm_medium=email&utm_source=footer>
    .

    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups
    "Ansible Project" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to ansible-project+unsubscribe@googlegroups.com.
    To post to this group, send email to ansible-project@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/ansible-project/CAMFyvFjCRDbiL_hQv%3D-Z_nw6aS99P1203U_hDhTnAiLPrNENQQ%40mail.gmail.com
    <https://groups.google.com/d/msgid/ansible-project/CAMFyvFjCRDbiL_hQv%3D-Z_nw6aS99P1203U_hDhTnAiLPrNENQQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
    .

    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups
    "Ansible Project" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to ansible-project+unsubscribe@googlegroups.com.
    To post to this group, send email to ansible-project@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgz5GqkAnEqjhTBzZdBUpzT%3D5%3DEKNd%2Bgd-ZtLZxk8Fas1w%40mail.gmail.com
    <https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgz5GqkAnEqjhTBzZdBUpzT%3D5%3DEKNd%2Bgd-ZtLZxk8Fas1w%40mail.gmail.com?utm_medium=email&utm_source=footer>
    .

    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "Ansible Project" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscribe@googlegroups.com.
    To post to this group, send email to ansible-project@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAMFyvFgRjFNj4EV05MNpPPwCgXO5Pkey6z28T-26DF0FumYCEw%40mail.gmail.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupansible-project @
postedSep 29, '14 at 3:14p
activeSep 30, '14 at 8:54p
posts7
users4

People

Translate

site design / logo © 2022 Grokbase