1, 6 and 7 the analog system (11, 7 correspond to 12 corresponding to 6)
[root@linux-node1 ansible]# cat test_template2.yaml --- - hosts: date remote_user: root vars: - http_port: 99 tasks: - name: install package yum: name=nginx - name: copy 7 template template: src=nginx.conf11.j2 dest=/etc/nginx/nginx.conf when: ansible_distribution_major_version == "7" notify: restart service - name: copy 6 template template: src=nginx.conf12.j2 dest=/etc/nginx/nginx.conf when: ansible_distribution_major_version == "6" notify: restart service - name: start service service: name=nginx state=started enabled=yes handlers: - name: restart service service: name=nginx state=restarted