Hello,
I’m using ansible-0.4 and have a problem. I write a play to update openssh-server pkg, copy new sshd config to server, then restart the sshd service. The first time I run the playbook, it’s works. But when I rerun it, the ansible-playbook stop right after copy action done, with this error:
ERROR: change handler (r) is not defined
If I make a change to playbook file (add a new blank line, or a space), it works again.
This happen when the one yum repo configuration file on remote server miss the name parameter (see the repo file below). This is full output of ansible-playbook:
SETUP PHASE ****************************
ok: [192.168.6.4]
TASK: [ensure openssh-server is latest] *********
fatal: [192.168.6.4] => failed to parse: Repository ‘remi’ is missing name in configuration, using id
{“changed”: false}
/Repository ‘remi’ is missing name in configuration, using id{“changed”: false}
/yum pkg=openssh-server state=latest
TASK: [copy the ssh config file] *********
ERROR: change handler (r) is not defined
This is my play:
- hosts: chinfon
tasks:
- name: ensure openssh-server is latest
action: yum pkg=openssh-server state=latest- name: copy the ssh config file
action: copy src=tpl/sshd_config dest=/etc/ssh/sshd_config owner=root group=root mode=600
notify: restart sshdhandlers:
- name: restart sshd
action: service name=sshd state=restarted
And this is my repo file on remote server:
[remi]
missing name config
mirrorlist=http://rpms.famillecollet.com/enterprise/$releasever/remi/mirror
enabled=1
gpgcheck=0
Is this a bug or my configuration is wrong?
Regards,