123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- ---
- -
- gather_facts: false
- hosts: tag_type_webinar
- become: yes
- vars:
- mysql_root_password: "mypass"
- tasks:
- - name: Install LAMP
- apt: pkg={{ item }} state=installed update_cache=true
- with_items:
- - apache2
- - mysql-server
- - mysql-client
- - python-mysqldb
- - libmysqlclient-dev
- - php-fpm
- - php-gd
- - php-curl
- - php-mysql
- - php-dom
- - php-xml
- - name: Enable apache2 modules
- command: a2enmod rewrite actions alias
- - name: Upload apache2 default configuration
- copy: src=files/000-default.conf dest=/etc/apache2/sites-enabled/
- - name: Remove default apache2 index.html file
- ignore_errors: yes
- command: rm /var/www/html/index.html
- - name: Upload default index.php for host
- copy: src=files/index.php dest=/var/www/html/ mode=0644
- - name: Restart webserver
- service: name=apache2 state=restarted
- - name : Ensure mysql started
- become: yes
- service: name=mysql state=started enabled=yes
- - name: Update MySQL root password for all root accounts
- mysql_user: name=root
- host={{ item }}
- password={{ mysql_root_password }}
- login_user=root
- login_password=""
- state=present
- with_items:
- - 127.0.0.1
- - ::1
- - localhost
- - name: Configure php-fom with apache2
- become: true
- copy: src=files/www.conf dest=/etc/php/7.0/fpm/pool.d/
|