condition - register is not a legal parameter of an Ansible Play -


i trying run simple ansible playbook keep getting following error , i'm not sure why.

error: register not legal parameter of ansible play

below code trying execute

---  - name: selinux sestatus   command: sestatus | grep enforcing | grep 'config file'   register: sestatus  - name: check if module1.pp exists   stat:     path: bin/module1.pp   register: module1_pp  - name: disable selinux if enforcing   sudo: yes   command: "{{ item }}"   with_items:     - setenforce 0     - semodule -i bin/module1.pp     - setsebool -p httpd_can_network_connect 1   when: sestatus.rc == 0 , module1.stat.exists == true 

that's entire playbook? you're missing hosts , tasks declaration.


- hosts: some_hosts   tasks:    - name: selinux sestatus     command: sestatus | grep enforcing | grep 'config file'     register: sestatus    - name: check if module1.pp exists     stat:       path: bin/module1.pp     register: module1_pp    - name: disable selinux if enforcing     sudo: yes     command: "{{ item }}"     with_items:       - setenforce 0       - semodule -i bin/module1.pp       - setsebool -p httpd_can_network_connect 1     when: sestatus.rc == 0 , module1.stat.exists == true 

Comments

Popular posts from this blog

python Tkinter Capturing keyboard events save as one single string -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

javascript - Z-index in d3.js -