- name: "create testuser account" user: name: testuser password_lock: yes - name: "allow deployer access to testuser via ssh" authorized_key: user: testuser key: "{{ deployer_ssh_pub }}" exclusive: yes - name: "create /srv/http" file: state: directory path: /srv/http owner: testuser group: testuser - name: "install apache2" apt: name: apache2 - name: "add virtual host for /srv/http" copy: src: testenv.conf dest: /etc/apache2/sites-available/testenv.conf - name: "enable virtual host" shell: | a2ensite testenv - name: "restart apache2" systemd: name: apache2 state: restarted