It's not even that they are switched so much that the *after* value should
still be the same filename, as it's a before and after at the same point in
time.

This is definitely a bug.

If you're seeing this on 1.4.X or later, please file a ticket on github so
we can fix the before and after captions.




On Thu, Jan 9, 2014 at 2:18 PM, Matt Garren <[email protected]>wrote:

> Just noticed an issue with ansible 1.4.1 trying to deploy a networking
> configuration for dhcp.  Will paste configs below with hostnames changed:
>
>
>
> *Playbook:*
>
> #playbook.yml
>
> ---
>
> - hosts: "{{ dhcp_hosts }}"
>   user: ansible
>   sudo: yes
>
>   roles:
>         - /home/ansible/Ansible/roles/dhcp
>
>   tasks:
>
>
>
>      - name: Ensure that dhclient is installed first
>        yum:  name=dhclient
>              state=present
>        tags: deploy
>
>      - name: Restart the network
>        service:   name=network
>                   state=restarted
>        tags:    network
>
>
> *DHCP ROLE:*---
>
> #Drop a network config for dhcp
> #
>
>    #Drop the /etc/sysconfig/network-script/ifcfg-eth0 template
>    - name: Drop the ifcfg-eth0 script
>      template:  src=/home/ansible/Ansible/templates/dhcp/ifcfg-eth0.j2
>                 dest=/etc/sysconfig/network-scripts/ifcfg-eth0
>                 owner=root
>                 group=root
>                 mode=0644
>      tags:      deploy
>
>    - name: Drop the /etc/dhclient-eth0.conf file
>      copy:      src=/home/ansible/Ansible/files/dhcp/dhclient-eth0.conf
>                 dest=/etc/dhclient-eth0.conf
>                 owner=root
>                 group=root
>                 mode=0644
>      tags:      deploy
>
>
> When the above playbook and role are run without --check (even with
> --diff), it functions as expected.  The appropriate template is dropped as
> ifcfg-eth0.  Where it gets interesting is if you run the same code with
> "--check --diff":
>
> TASK: [/home/ansible/Ansible/roles/dhcp | Drop the ifcfg-eth0 script]
> *********
> --- before: /etc/sysconfig/network-scripts/ifcfg-eth0
> +++ after: /home/ansible/Ansible/templates/dhcp/ifcfg-eth0.j2
> @@ -1,5 +1,8 @@
>  DEVICE=eth0
> -HWADDR=*###REMOVED###*
> +BOOTPROTO=dhcp
> +USERCTL=no
>  ONBOOT=yes
> -BOOTPROTO=dhcp
> -DHCP_HOSTNAME=*###REMOVED###*
> +check_link_down() {
> + return 1;
> +}
> +DHCP_HOSTNAME=*###REMOVED###*
>
> changed: [*###REMOVED###*]
>
>
> It seems as though ansible implementation has the "src" and "dst" flags
> switched, only when run with a "--diff --check".  Has anyone else seen this
> behavior?  The --check and --diff are vital components of our testing to
> make sure we don't deploy incorrect configs to our production servers.
>
>
> Also, I have ensured that there is not a .j2 file present on any target
> servers and have tested across 10 different servers.
>
> Thanks,
> Matt
>
>  --
> 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 [email protected].
> To post to this group, send email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Michael DeHaan <[email protected]>
CTO, AnsibleWorks, Inc.
http://www.ansibleworks.com/

-- 
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 [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to