-
Notifications
You must be signed in to change notification settings - Fork 7
/
magento1.yml
65 lines (53 loc) · 2.44 KB
/
magento1.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Install Magento1 on a Hypernode
# necessary parameters:
# app_name
# magento_installation_path
# magento_baseurl
# admin (hash containing keys first_name, last_name, password, locale, email)
# admin_password
# admin_frontname
# mysqlhost
# mysql_app_user
# mysql_app_password
# magento_db
---
- hosts: all
tasks:
- name: ensure Nginx config for Magento 1.X
file: state=absent force=yes path=/data/web/nginx/magento2.flag
- name: generate custom Magento settings for "app" user
template: src=templates/n98-magerun.yaml.j2 dest=/data/web/.n98-magerun.yaml owner=app group=app force=no
- name: update sql password for "app" user
mysql_user: name={{ mysql_app_user }} password={{ mysql_app_password }} priv=*.*:ALL,GRANT host=%
- name: update sql password in user my.cnf
ini_file: dest=/data/web/.my.cnf section=client option=password value={{ mysql_app_password }} mode=0600
- name: create database for new Magento installation
mysql_db: name={{ magento_db }} state=present
- name: register installation path contents
shell: tree {{ magento_installation_path }} -L 1
register: display_magento_dir
- name: install Magento as "app" user
when: not display_magento_dir.stdout|search('mage')
command: >
/usr/local/bin/n98-magerun install
--dbHost='{{ mysqlhost }}'
--dbUser='{{ mysql_app_user }}'
--dbPass='{{ mysql_app_password }}'
--dbName='{{ magento_db }}'
--installSampleData=no
--useDefaultConfigParams=yes
--magentoVersionByName='byte-mag-mirror-latest'
--installationFolder='{{ magento_installation_path }}'
--baseUrl='{{ magento_baseurl }}'
--replaceHtaccessFile=no
--no-interaction
- name: add Redis settings to Magento config xml
copy: src=files/local.redis.xml dest='{{ magento_installation_path }}/app/etc/local.redis.xml' owner=app group=app
- name: copy custom Hypernode Magento theme
unarchive: src=files/hypernode-magento-theme.zip dest={{ magento_installation_path }} owner=app group=app
- name: configure Hypernode Magento theme
command: /usr/local/bin/n98-magerun --root-dir=/data/web/public config:set "design/package/name" "hypernode"
- name: set Hypernode Magento theme to default
command: /usr/local/bin/n98-magerun --root-dir=/data/web/public config:set "design/theme/default" "default"
- name: flush Magento cache
shell: /usr/local/bin/n98-magerun --root-dir=/data/web/public cache:flush