Okay, we've ran out of ip addresses, and got a larger subnet from our ip. I 
am currently in the process of switching them over, and decided it would be 
nice to do this with ansible, but I have ran into a little snag. 

Currently I have:

    - shell: "ifconfig | grep -B1 {{ old_address }}| grep -E 
'^(\\w+)[[:space:]]' | sed 's/\\s.*$//'"
      args:
        executable: /bin/bash
      register: network_interface

    - template:
        src: files/linux_network_interfaces.j2
        dest: /etc/network/interfaces
        owner: root
        group: root
        mode: '0644'
      become: true
      when: item.key == inventory_hostname
      with_dict: "{{ new_addresses }}"

    - shell: "ifdown {{ network_interface.stdout }} && ifup {{ 
network_interface.stdout }}"
      args:
        executable: /bin/bash
      become: true

But it hangs in the last shell task... since the IP address was changed. 

Is there a way I can tell this task to just run, then use set_fact to 
modify each host to its new IP to ping and make sure it worked, then I'll 
move forward and modify our DNS records to match the new hosts..

-- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/d85b66db-2c96-4494-ba49-caf49c7b628f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to