Skip to content

Commit 3e6694c

Browse files
init
1 parent d4cff8c commit 3e6694c

File tree

35 files changed

+70
-240
lines changed

35 files changed

+70
-240
lines changed

group_vars/all.yml

+2-9
Original file line numberDiff line numberDiff line change
@@ -955,7 +955,6 @@ magento_admin_user_lastname: Suite
955955

956956
# Path to node warmup script executed at instance start relative to magento app root dir - never need to override...
957957
magento_node_warmup_script_path: /bin/node-warmup.sh
958-
mageops_wait_for_warmup_secs: 600
959958

960959
# ------------------------------
961960
# -------- Magento SCD --------
@@ -1673,8 +1672,6 @@ varnish_strip_params:
16731672
- "{{ https_termination_redirect_source_domain_param }}"
16741673

16751674
varnish_debug_request_info_header_name: "{{ mageops_debug_http_header_prefix }}-Info-Varnish"
1676-
varnish_bypass_request_info_header_name: "{{ mageops_bypass_http_header_prefix }}-Info-Varnish"
1677-
16781675

16791676
# ----------------------------------------------------------
16801677
# -------- Varnish Language Detection & Redirects --------
@@ -1823,11 +1820,6 @@ mageops_cli_features_dir: /usr/local/lib/mageops/features
18231820
# Whether to perform full update
18241821
mageops_packages_full_update: yes
18251822

1826-
# Package manager to use
1827-
mageops_pkg_mgr:
1828-
# Supported options: dnf, yum
1829-
centos7: dnf
1830-
18311823
# Packages that are ensured to be absent on all nodes
18321824
mageops_packages_mirrorlist_countrycode: "de"
18331825

@@ -2055,4 +2047,5 @@ aws_pio_ebs_volume_size: "{{ aws_app_node_ebs_volume_size }}"
20552047
# ----- New Relic -----
20562048
# ---------------------
20572049
new_relic_app_name: "{{ mageops_app_name }}"
2058-
mageops_new_relic_enabled: yes
2050+
mageops_new_relic_enabled: no
2051+
# new_relic_license need to be set up

requirements-python.txt

-4
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ ansible>=6,<7
44
# make sure this is BEFORE boto3 and boto
55
awscli
66

7-
# some tasks call aws command on localhost
8-
# make sure this is BEFORE boto3 and boto
9-
awscli
10-
117
# needed for inventory and aws modules
128
boto3
139

roles/cs.aws-iam-employee-access/templates/employee_full_access.policy.json

+1-5
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"Effect": "Allow",
3030
"Resource": "arn:aws:pi:*:*:metrics/rds/*"
3131
},
32+
3233
{
3334
"Action": "ec2:*",
3435
"Effect": "Allow",
@@ -306,11 +307,6 @@
306307
"freetier:Get*"
307308
],
308309
"Resource": "*"
309-
},
310-
{
311-
"Action": "dlm:*",
312-
"Effect": "Allow",
313-
"Resource": "*"
314310
}
315311
]
316312
}

roles/cs.aws-iam/defaults/main.yml

-5
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ aws_iam_policy_cloudwatch_metrics_access: "{{ aws_iam_name_prefix }}CloudWatchMe
1212
aws_iam_policy_lambda_access: "{{ aws_iam_name_prefix }}LambdaAccess"
1313
aws_iam_policy_kms_access: "{{ aws_iam_name_prefix }}KmsAccess"
1414

15-
aws_iam_policy_dlm_sts_access: "{{ aws_iam_name_prefix }}DLMAllowSTSAccess"
16-
aws_iam_policy_dlm_aws_access: "{{ aws_iam_name_prefix }}DLMAccess"
17-
1815
aws_iam_group_custom_policies: "{{ aws_iam_name_prefix }}CustomPolicies"
1916
aws_iam_group_standard_policies: "{{ aws_iam_name_prefix }}StandardPolicies"
2017

@@ -32,5 +29,3 @@ aws_iam_role_node_coordinator_lambda_execution: "{{ aws_iam_name_prefix }}Handle
3229
aws_iam_role_app_node: "{{ aws_iam_name_prefix }}AppNode"
3330
aws_iam_role_varnish: "{{ aws_iam_role_app_node }}"
3431
aws_iam_role_persistent_node: "{{ aws_iam_name_prefix }}PersistentNode"
35-
36-
aws_iam_role_dlm: "{{ aws_iam_name_prefix }}DLM"

roles/cs.aws-iam/tasks/dlm-roles.yaml

-23
This file was deleted.

roles/cs.aws-iam/tasks/main.yml

-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@
33
- import_tasks: lambda-roles.yml
44
- import_tasks: kms-roles.yml
55
- import_tasks: provisioning-groups.yml
6-
- import_tasks: dlm-roles.yml

roles/cs.aws-iam/templates/aws_dlm_access.policy.json

-46
This file was deleted.

roles/cs.aws-iam/templates/aws_dlm_sts_access.policy.json

-12
This file was deleted.

roles/cs.cloudflare/defaults/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cloudflare_enabled: no
2-
# Accept only traffic coming from Cloudflare
2+
# Accept only traffic comming from Cloudflare
33
cloudflare_exclusive_traffic: yes
44

55
# configuration file paths

roles/cs.geolite2/tasks/main.yml

+1-6
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,7 @@
1010
- name: Install geoupdate configuration
1111
template:
1212
src: GeoIP.conf.j2
13-
dest: /usr/local/etc/GeoIP.conf
14-
15-
- name: Install geoupdate 6.x configuration
16-
template:
17-
src: GeoIP6.conf.j2
18-
dest: /usr/local/etc/GeoIP.conf
13+
dest: /etc/GeoIP.conf
1914

2015
- name: Update geolite2 databases
2116
shell: geoipupdate

roles/cs.geolite2/templates/GeoIP6.conf.j2

-3
This file was deleted.

roles/cs.magento-configure/tasks/000-prepare-runtime-config.yml

+13-1
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,20 @@
6363
magento_core_config_settings: "{{ magento_core_config_settings + magento_baler_js_bundling_core_config }}"
6464
when: magento_scd_advanced_js_bundling and magento_scd_advanced_js_bundling_strategy == 'baler'
6565

66+
- name: Install required python modules
67+
yum:
68+
# Required for the `mysql_query` module
69+
name: python2-PyMySQL
70+
state: present
71+
72+
- name: Download CA RDS
73+
ansible.builtin.get_url:
74+
url: https://truststore.pki.rds.amazonaws.com/eu-central-1/eu-central-1-bundle.pem
75+
dest: /tmp/eu-central-1-bundle.pem
76+
mode: '0666'
77+
6678
- name: Check if database is initialized
67-
command: mysql -N --batch -u {{ mageops_app_mysql_user|quote }} -p{{ mageops_app_mysql_pass|quote }} -h {{ mageops_mysql_host|quote }} -e "SHOW TABLES FROM `{{ mageops_app_mysql_db }}` LIKE 'admin_user';"
79+
command: mysql --ssl-ca=/tmp/eu-central-1-bundle.pem -N --batch -u {{ mageops_app_mysql_user|quote }} -p{{ mageops_app_mysql_pass|quote }} -h {{ mageops_mysql_host|quote }} -e "SHOW TABLES FROM `{{ mageops_app_mysql_db }}` LIKE 'admin_user';"
6880
changed_when: false
6981
register: admins
7082

roles/cs.magento-configure/tasks/080-core-config.yml

+31-23
Original file line numberDiff line numberDiff line change
@@ -9,54 +9,62 @@
99
magento_core_config_settings: "{{ magento_core_config_settings + _extra_items }}"
1010
when: magento_varnish_host | default(false, true)
1111

12+
- name: Download CA RDS
13+
ansible.builtin.get_url:
14+
url: https://truststore.pki.rds.amazonaws.com/eu-central-1/eu-central-1-bundle.pem
15+
dest: /tmp/eu-central-1-bundle.pem
16+
mode: '0666'
17+
1218
- name: Ensure core config database settings' values
1319
community.mysql.mysql_query:
14-
login_db: "{{ mageops_app_mysql_db }}"
20+
name: "{{ mageops_app_mysql_db }}"
21+
table: core_config_data
1522
login_host: "{{ mageops_mysql_host }}"
1623
login_user: "{{ mageops_app_mysql_user }}"
1724
login_password: "{{ mageops_app_mysql_pass }}"
18-
query: |
19-
INSERT INTO `core_config_data`
20-
SET
21-
path = "{{ magento_db_setting.path | quote }}",
22-
value = "{{ magento_db_setting.value | quote }}",
23-
scope_id = 0,
24-
scope = "default"
25-
ON DUPLICATE KEY UPDATE
26-
value = "{{ magento_db_setting.value | quote }}"
25+
ca_cert: /tmp/eu-central-1-bundle.pem
26+
identifiers:
27+
path: "{{ magento_db_setting.path }}"
28+
values:
29+
value: "{{ magento_db_setting.value }}"
30+
defaults:
31+
scope_id: 0
32+
scope: "default"
2733
when: not magento_db_setting.default | default(false) and magento_db_setting.value | default(false) is string and magento_db_setting.enabled | default(true)
2834
loop: "{{ magento_core_config_settings }}"
2935
loop_control:
3036
loop_var: magento_db_setting
3137

3238
- name: Ensure core config database default values (no update if exists)
3339
community.mysql.mysql_query:
34-
login_db: "{{ mageops_app_mysql_db }}"
40+
name: "{{ mageops_app_mysql_db }}"
41+
table: core_config_data
3542
login_host: "{{ mageops_mysql_host }}"
3643
login_user: "{{ mageops_app_mysql_user }}"
3744
login_password: "{{ mageops_app_mysql_pass }}"
38-
query: |
39-
INSERT IGNORE INTO `core_config_data`
40-
SET
41-
path = "{{ magento_db_setting.path | quote }}",
42-
value = "{{ magento_db_setting.value | quote }}",
43-
scope_id = 0,
44-
scope = "default"
45+
ca_cert: /tmp/eu-central-1-bundle.pem
46+
identifiers:
47+
path: "{{ magento_db_setting.path }}"
48+
defaults:
49+
scope_id: 0
50+
scope: "default"
51+
value: "{{ magento_db_setting.value }}"
4552
when: magento_db_setting.default | default(false) and magento_db_setting.value | default(false) is string and magento_db_setting.enabled | default(true)
4653
loop: "{{ magento_core_config_settings }}"
4754
loop_control:
4855
loop_var: magento_db_setting
4956

5057
- name: Ensure core config database settings are absent (defaults are used)
5158
community.mysql.mysql_query:
52-
login_db: "{{ mageops_app_mysql_db }}"
59+
state: absent
60+
name: "{{ mageops_app_mysql_db }}"
61+
table: core_config_data
5362
login_host: "{{ mageops_mysql_host }}"
5463
login_user: "{{ mageops_app_mysql_user }}"
5564
login_password: "{{ mageops_app_mysql_pass }}"
56-
query: |
57-
DELETE FROM core_config_data
58-
WHERE
59-
path = "{{ magento_db_setting_path | quote }}"
65+
ca_cert: /tmp/eu-central-1-bundle.pem
66+
identifiers:
67+
path: "{{ magento_db_setting_path }}"
6068
loop: "{{ magento_core_config_settings_to_remove }}"
6169
loop_control:
6270
loop_var: magento_db_setting_path

roles/cs.mageops-cli/files/mageopscli

-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ main::help() {
151151
main::eprintln " is_feature_flag_set <feature> Checks if there is any value set for feature flag"
152152
main::eprintln " status code 0 means flag is set, 1 otherwise"
153153
main::eprintln " apply_features Apply feature updates to this host"
154-
main::eprintln " clear_opcache Clears opcache for php and php-fpm"
155154
main::eprintln ""
156155
main::eprintln " Mageops cli tools"
157156
main::eprintln " (c) Creativestyle 2020"

roles/cs.mysql-configure/tasks/create-db.yml

+9
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1+
- name: Download CA RDS
2+
ansible.builtin.get_url:
3+
url: https://truststore.pki.rds.amazonaws.com/eu-central-1/eu-central-1-bundle.pem
4+
dest: /tmp/eu-central-1-bundle.pem
5+
mode: '0666'
6+
17
- name: Ensure project database exists
28
mysql_db:
39
login_host: "{{ mageops_mysql_host }}"
410
login_user: "{{ mageops_mysql_root_user }}"
511
login_password: "{{ mageops_mysql_root_pass }}"
612
name: "{{ mageops_app_mysql_db }}"
713
state: present
14+
ca_cert: /tmp/eu-central-1-bundle.pem
815

916
- name: Ensure project db user for external connections exists
1017
mysql_user:
@@ -15,6 +22,7 @@
1522
password: "{{ mageops_app_mysql_pass }}"
1623
host: "%"
1724
state: present
25+
ca_cert: /tmp/eu-central-1-bundle.pem
1826
priv: "{{ mageops_app_mysql_db }}.*:{{ mysql_configure_all_db_permissions }}"
1927

2028
- name: Ensure project db user for localhost exists
@@ -26,5 +34,6 @@
2634
password: "{{ mageops_app_mysql_pass }}"
2735
host: "localhost"
2836
state: present
37+
ca_cert: /tmp/eu-central-1-bundle.pem
2938
priv: "{{ mageops_app_mysql_db }}.*:{{ mysql_configure_all_db_permissions }}"
3039
when: mysql_user_localhost_access

roles/cs.new-relic/defaults/main.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
new_relic_repo_url: http://yum.newrelic.com/pub/newrelic/el5/x86_64/newrelic-repo-5-3.noarch.rpm
22
new_relic_packages:
33
- newrelic-php5
4-
new_relic_license:
4+
# new_relic_license:
55
new_relic_app_name: "New relic app name"
66
new_relic_collector_enabled: yes
77
new_relic_ignore_user_exception_handler: no
@@ -15,7 +15,7 @@ new_relic_stact_trace_threshold: "3s"
1515
new_relic_explain_enabled: yes
1616
new_relic_explain_threshold: "500ms"
1717
new_relic_framework: magento2
18-
new_relic_enabled: "{{ new_relic_license != '' }}"
18+
new_relic_enabled: yes
1919

2020
new_relic_cron_enabled: no
2121
new_relic_cron_start: "0 7 * * *" # From 7:00

0 commit comments

Comments
 (0)