pass variable to handler?

27 views
Skip to first unread message

pixel fairy

unread,
Dec 9, 2015, 9:06:27 PM12/9/15
to Ansible Project
Using the lxc module, and want to do this. is there a way?

  - name: skip dns lookup so ssh doesnt take forever
    lineinfile
:
      line
: UseDNS no
      dest
: /var/lib/lxc/{{ item.key }}/rootfs/etc/ssh/sshd_config
    with_dict
: "{{ containers }}"
    notify
: restart ssh

  handlers
:
 
- name: restart ssh
    command
: lxc-attach --name {{ item.key }} -- service ssh restart
    with_dict
: "{{ containers }}"


results in

RUNNING HANDLER [restart ssh] **************************************************
fatal
: [lxctest]: FAILED! => {"failed": true, "msg": "ERROR! 'item' is undefined"}



Reply all
Reply to author
Forward
0 new messages