Advertisement
Guest User

Untitled

a guest
Jan 6th, 2019
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 0.91 KB | None | 0 0
  1. ---
  2. - hosts: localhost
  3.   connection: local
  4.  
  5.   vars_prompt:
  6.    - name: 'username'
  7.      prompt: 'Username'
  8.      private: no
  9.    - name: 'userpass'
  10.      prompt: 'Password'
  11.      private: no
  12.  
  13.   tasks:    
  14.     - name: 'Add PHP repo'
  15.       action: 'apt_repository repo=ppa:ondrej/php update_cache=yes'
  16.  
  17.     - name: 'Install packages'
  18.       apt:
  19.         name:
  20.          - php7.0-fpm
  21.           - php7.1-fpm
  22.           - php7.2-fpm
  23.           - php7.3-fpm
  24.           - apache2
  25.         state: latest
  26.         update_cache: no
  27.  
  28.     - name: 'Enable Apache2 modules'
  29.       apache2_module:
  30.         name: "{{ item }}"
  31.         state: present
  32.       with_items:
  33.        - rewrite
  34.         - proxy
  35.         - proxy_fcgi
  36.  
  37.     - name: 'Create user'
  38.       user: 'name={{ username }} password={{userpass |password_hash("sha512") }} update_password=on_create shell=/bin/bash home=/home/{{ username }} state=present'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement