- hosts: [tel,edu] vars: retour: "" tasks: - name: "packages are installed" apt: name='{{ item }}' with_items: - apache2-mpm-itk - apachetop - libapache2-mod-evasive - libwww-perl - name: "copier la config d'apache" copy: src=config.cfg dest=/etc/apache2/conf-available/ owner=root group=root mode="640" # Ceci est un commentaire - name: "Arret des machines Debian et Ubuntu parmis les autres systèmes" command: /sbin/shutdown -t now when: (ansible_os_family == "Debian") or (ansible_os_family == "Ubuntu") - name: use epoll lineinfile: dest: /etc/nginx/nginx.conf regexp: '^(\s*use)\s+.+;' line: ' use epoll;' insertafter: 'events \{' - name : insérer une chaine dans un fichier copy: content="your config line here" dest="/path/to/file" - name: fichier vpasswd is present? stat: path: /etc/proftpd/vpasswd register: file_is_present - name: debug debug: var: ansible_user - debug: var=ansible_facts