Ansible role to install OwnCloud
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

83 lines
1.9 KiB

---
- name: Add OwnCloud Repository Key
apt_key:
url : 'https://download.owncloud.org/download/repositories/stable/xUbuntu_16.04/Release.key'
state: 'present'
- name: Setup OwnCloud Repo
apt_repository:
repo: 'deb http://download.owncloud.org/download/repositories/stable/xUbuntu_16.04/ /'
- name: Update apt cache
apt: update_cache=yes
- name: Install OwnCloud Packages
apt: name='{{ item }}'
with_items: '{{ owncloud_packages }}'
- name: Configure nginx vhost
template:
src : 'nginx/owncloud.j2'
dest: '/etc/nginx/sites-enabled/owncloud'
mode: 0755
notify: Restart nginx
- name: Set MySQL log format to Mixed
ini_file:
dest: '/etc/mysql/my.cnf'
section: 'mysqld'
option: 'binlog_format'
value: 'MIXED'
state: 'present'
backup: 'yes'
notify: Restart mysql
- name: php-redis
include: 'php-redis.yml'
- name: Create MySQL database for OwnCloud
mysql_db:
db : '{{ owncloud_mysql_dbname }}'
state: 'present'
- name: Create MySQL user for OwnCloud
mysql_user:
name : '{{ owncloud_mysql_user }}'
password : '{{ owncloud_mysql_password }}'
state : 'present'
append_privs: yes
priv : 'owncloud.*:ALL'
- name: Ensure that OwnCloud data dir is present
file:
path : '{{ owncloud_data_dir }}'
state : directory
owner : 'www-data'
group : 'www-data'
recurse: yes
- name: Setup Logrotate for owncloud.log
template:
src : 'logrotate.j2'
dest : '/etc/logrotate.d/owncloud'
owner: 'root'
group: 'root'
mode : 0644
- name: Configure OwnCloud Autoconfig
template:
src : 'owncloud/autoconfig.php.j2'
dest : '/var/www/owncloud/config/autoconfig.php'
mode : 0744
owner: 'www-data'
group: 'www-data'
- name: Connect OwnCloud to Redis
template:
src : 'owncloud/redis.config.php.j2'
dest: '/var/www/owncloud/config/redis.config.php'
when: '{{ redis_enabled }}'