getting ERROR: hosts declaration is required
and i  have changed  lineinfile: to action: lineinfile

---
 - hosts: webservers
   remote_user: xyz
   sudo: true
   vars:
    Myname: ${ansible_fqdn}
   tasks:
 - name: copy postfix1 files to servers
 - lineinfile: dest=/etc/postfix/main.cf regexp="^#myorigin = $mydomain" 
line="myorigin = $mydomain" state=present
 - name: copy postfix2 files to servers
 - lineinfile: dest=/etc/postfix/main.cf regexp="^#myhostname = 
host.domain.tld" line="#myhostname = {{ Myname }}" state=present
 - name: copy postfix3 files to servers
 - lineinfile: dest=/etc/postfix/main.cf regexp="^#relayhost = 
[an.ip.add.ress]" line="relayhost = mailroute.corpr.jjkeller.local" 
state=present
 - name: copy postfix4 files to servers
 - lineinfile: dest=/etc/postfix/main.cf regexp="^#mynetworks = 
168.100.189.0/28, 127.0.0.0/8 " line="mynetworks = 101.0.0.0/8, 10.0.0.0/8, 
127.0.0.0/8" state=present
 - name: copy postfix5 files to servers
 - lineinfile: dest=/etc/postfix/main.cf regexp="^#myhostname = 
host.domain.tld" line="#myhostname = {{ Myname }}" state=present
 - name: restart postfix servers
   service: name=postfix state=reloaded  enabled=yes

-- 
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/3c30b7ff-1657-424d-9915-abb78fcec00c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to