- hosts: 127.0.0.1
tasks:
- name: Create a install directory if it does not exist
file:
path: "{{ install_path }}"
state: directory
owner: "{{ user_name }}"
group: "{{ user_name }}"
mode: "0755"
recurse: yes
- name: Download bitrix
get_url:
url: "http://www.1c-bitrix.ru/download/standard_encode.tar.gz"
dest: "{{ install_path }}/standard_encode.tar.gz"
mode: "644"
timeout: 1800
owner: "{{ user_name }}"
group: "{{ user_name }}"
- name: Unpack bitrix archive
unarchive:
src: "{{ install_path }}/standard_encode.tar.gz"
dest: "{{ install_path }}"
remote_src: yes
owner: "{{ user_name }}"
group: "{{ user_name }}"
- name: Set the permissions on Bitrix directories
command: find {{ install_path }} -type d -exec chmod 755 {} \;
- name: Set the permissions for Bitrix files
command: find {{ install_path }} -type f -exec chmod 644 {} \;
- name: Create a directory if it does not exist
file:
path: "{{ install_path }}/bitrix/php_interface"
state: directory
owner: "{{ user_name }}"
group: "{{ user_name }}"
mode: "0755"
- name: copy dbconn.php
template:
src: templates/dbconn.php.j2
dest: "{{ install_path }}/bitrix/php_interface/dbconn.php"
owner: "{{ user_name }}"
group: "{{ user_name }}"
mode: 0644
- name: copy .settings.php
template:
src: templates/.settings.php.j2
dest: "{{ install_path }}/bitrix/.settings.php"
owner: "{{ user_name }}"
group: "{{ user_name }}"
mode: 0644
- name: copy after_connect_d7.php
template:
src: templates/after_connect_d7.php.j2
dest: "{{ install_path }}/bitrix/php_interface/after_connect_d7.php"
owner: "{{ user_name }}"
group: "{{ user_name }}"
mode: 0644
- name: copy after_connect.php
template:
src: templates/after_connect.php.j2
dest: "{{ install_path }}/bitrix/php_interface/after_connect.php"
owner: "{{ user_name }}"
group: "{{ user_name }}"
mode: 0644
- name: Delete archive
file:
path: "{{ install_path }}/standard_encode.tar.gz"
state: absent