fabrica/.packer/provisioning/playbooks/syspass.yml

67 lines
1.5 KiB
YAML
Raw Normal View History

---
- name: Installation Syspass
hosts: all
environment:
http_proxy: "{{ lookup('env','http_proxy') }}"
https_proxy: "{{ lookup('env','https_proxy') }}"
HTTPS_PROXY: "{{ lookup('env','HTTPS_PROXY') }}"
HTTP_PROXY: "{{ lookup('env','HTTP_PROXY') }}"
tasks:
- name: Update package cache
apt:
update_cache: yes
- name: Install mariadb
apt:
name:
- mariadb-server
- python-mysqldb
- unzip
- apache2
- libapache2-mod-php
- php-pear
- php
- php-cgi
- php-cli
- php-common
- php-fpm
- php-gd
- php-json
- php-mysql
- php-readline
- php-curl
- php-intl
- php-ldap
- php-mcrypt
- php-xml
- php-mbstring
state: present
- name: Create a new database with name 'syspass'
mysql_db:
name: syspass
state: present
- name: Create mysql user
mysql_user:
name: spadmin
password: '63ApD2E0xVJlNi9+hqsZUQ=='
priv: 'syspass.*:ALL,GRANT'
state: present
- name: Create directory syspass
ansible.builtin.file:
path: /var/www/html/syspass
state: directory
owner: www-data
group: www-data
mode: '0750'
- name: Download Syspass
unarchive:
src: https://github.com/nuxsmin/sysPass/archive/3.2.1.zip
dest: /var/www/html/syspass
remote_src: yes