From d44f7b93376c4826ad41fefdb839c8c526cfbea7 Mon Sep 17 00:00:00 2001 From: aermike Date: Wed, 24 Oct 2018 16:13:29 +0300 Subject: [PATCH] ansible plybook for youphptube Works in debian9.x No parameters yet --- ansible-playbook | 127 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 ansible-playbook diff --git a/ansible-playbook b/ansible-playbook new file mode 100644 index 000000000000..bb7e2c465698 --- /dev/null +++ b/ansible-playbook @@ -0,0 +1,127 @@ +--- +- hosts: jitsi + become: true + pre_tasks: + - name: Update apt cache + apt: update_cache=yes cache_valid_time=3600 + + handlers: + - name: restart apache + service: name=apache2 state=restarted + + tasks: + + - name: instalez pachete necesare + apt: name={{ item }} state=present + with_items: + - software-properties-common + - dirmngr + - sudo + - python-mysqldb + + - name: adaug cheie + command: + apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xF1656F24C74CD1D8 + + - name: adaug repo + apt_repository: + repo: deb [arch=amd64,i386,ppc64el] http://ftp.osuosl.org/pub/mariadb/repo/10.2/debian stretch main + state: present + + - name: instalez mariadb + apt: + name: mariadb-server + state: present + + - name: remove test database + mysql_db: db=test state=absent + + - name: creez baza de date youPHPtube + mysql_db: db=youPHPTube state=present + + - name: creez user youphptube + mysql_user: + name: youphptube + password: passw0rd + priv: 'youPHPTube.*:ALL,GRANT' + host: localhost + state: present + + - name: creez baza de date youPHPTubeEncoder + mysql_db: db=youPHPTubeEncoder state=present + + - name: creez user youPHPTubeEncoder + mysql_user: + name: youphptubeencoder + password: passw0rd + priv: 'youPHPTubeEncoder.*:ALL,GRANT' + host: localhost + state: present + + - name: instalez alte pachete + apt: name={{ item }} state=present + with_items: + - curl + - apache2 + - php7.0 + - libapache2-mod-php7.0 + - php7.0-mysql + - php7.0-curl + - php7.0-gd + - php7.0-intl + - ffmpeg + - git + - libimage-exiftool-perl + - python + + - name: iau youPHPtube + git: + repo: https://github.com/DanielnetoDotCom/YouPHPTube.git + dest: /var/www/html/YouPHPTube + clone: yes + + - name: iau youPHPTubeEncoder + git: + repo: https://github.com/DanielnetoDotCom/YouPHPTube-Encoder.git + dest: /var/www/html/YouPHPTube-Encoder + clone: yes + + - name: iau youtube-dl si setez drepturi + command: "{{ item }}" + warn: False + with_items: + - curl -L https://youtube-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl + - chmod a+rx /usr/local/bin/youtube-dl + - a2enmod rewrite + notify: restart apache + + - name: creez director videos in youPHPtube + file: + path: /var/www/html/YouPHPTube/videos + state: directory + owner: www-data + group: www-data + mode: 0755 + + - name: creez director videos in youPHPTubeEncoder + file: + path: /var/www/html/YouPHPTube-Encoder/videos + state: directory + owner: www-data + group: www-data + mode: 0755 + + - name: modific php.ini + lineinfile: + dest: "{{ item.dest}}" + regexp: "{{ item.regexp }}" + line: "{{ item.line }}" + backrefs: yes + with_items: + - {dest: '/etc/php/7.0/apache2/php.ini', regexp: 'post_max_size = 8M', line: 'post_max_size = 1000M'} + - {dest: '/etc/php/7.0/apache2/php.ini', regexp: 'upload_max_filesize = 2M', line: 'upload_max_filesize = 1000M'} + - {dest: '/etc/php/7.0/apache2/php.ini', regexp: 'max_execution_time = 30', line: 'max_execution_time = 7200'} + - {dest: '/etc/php/7.0/apache2/php.ini', regexp: 'memory_limit = 128M', line: 'memory_limit = 512M'} + - {dest: '/etc/apache2/apache2.conf', regexp: ' AllowOverride None', line: 'AllowOverride All' } + notify: restart apache +