Skip to content

Commit 17cb5b0

Browse files
init
1 parent d4cff8c commit 17cb5b0

File tree

36 files changed

+44
-220
lines changed

36 files changed

+44
-220
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/defaults/main/app-etc.yml

-3
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,6 @@ magento_app_etc_config_consumer_workers:
165165
cron_consumers_runner:
166166
cron_run: false
167167
max_messages: "{{ magento_consumer_workers_max_messages | default(500) }}"
168-
queue:
169-
consumers_wait_for_messages: 0
170-
only_spawn_when_message_available: 1
171168

172169
magento_app_etc_config_cron_consumers:
173170
cron_consumers_runner:

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

+7-1
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,14 @@
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: Download CA RDS
67+
ansible.builtin.get_url:
68+
url: https://truststore.pki.rds.amazonaws.com/eu-central-1/eu-central-1-bundle.pem
69+
dest: /tmp/eu-central-1-bundle.pem
70+
mode: '0666'
71+
6672
- 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';"
73+
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';"
6874
changed_when: false
6975
register: admins
7076

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

+11
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,20 @@
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+
18+
1219
- name: Ensure core config database settings' values
1320
community.mysql.mysql_query:
1421
login_db: "{{ mageops_app_mysql_db }}"
1522
login_host: "{{ mageops_mysql_host }}"
1623
login_user: "{{ mageops_app_mysql_user }}"
1724
login_password: "{{ mageops_app_mysql_pass }}"
25+
ca_cert: /tmp/eu-central-1-bundle.pem
1826
query: |
1927
INSERT INTO `core_config_data`
2028
SET
@@ -35,6 +43,7 @@
3543
login_host: "{{ mageops_mysql_host }}"
3644
login_user: "{{ mageops_app_mysql_user }}"
3745
login_password: "{{ mageops_app_mysql_pass }}"
46+
ca_cert: /tmp/eu-central-1-bundle.pem
3847
query: |
3948
INSERT IGNORE INTO `core_config_data`
4049
SET
@@ -47,12 +56,14 @@
4756
loop_control:
4857
loop_var: magento_db_setting
4958

59+
5060
- name: Ensure core config database settings are absent (defaults are used)
5161
community.mysql.mysql_query:
5262
login_db: "{{ mageops_app_mysql_db }}"
5363
login_host: "{{ mageops_mysql_host }}"
5464
login_user: "{{ mageops_app_mysql_user }}"
5565
login_password: "{{ mageops_app_mysql_pass }}"
66+
ca_cert: /tmp/eu-central-1-bundle.pem
5667
query: |
5768
DELETE FROM core_config_data
5869
WHERE

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
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/usr/bin/env bash
22

33
feature__flag_name="newrelic_apm"
4-
feature__license_key="newrelic_license_key"
54

65
feature::apply() {
76
local expected
@@ -10,15 +9,9 @@ feature::apply() {
109
expected="$(feature::expected_value)"
1110
expected="$(feature::normalize_expected "$expected")"
1211
current="$(feature::current_value)"
13-
current_license="$(feature::current_license_value)"
14-
expected_license="$(feature::expected_license_value)"
1512

16-
if [ -z "$expected_license" ];then
17-
# We cannot enable the feature without a license key
18-
expected="false"
19-
fi
20-
if [ "$expected" != "$current" ] || [ "$expected_license" != "$current_license" ];then
21-
feature::update "$expected" "$expected_license"
13+
if [ "$expected" != "$current" ];then
14+
feature::update "$expected"
2215
fi
2316
}
2417

@@ -41,10 +34,6 @@ feature::expected_value() {
4134
features::read_feature_flag "$feature__flag_name" "false"
4235
}
4336

44-
feature::expected_license_value() {
45-
features::read_feature_flag "$feature__license_key" ""
46-
}
47-
4837
feature::current_value() {
4938
local current
5039

@@ -57,21 +46,12 @@ feature::current_value() {
5746
echo "$current"
5847
}
5948

60-
feature::current_license_value() {
61-
local current
62-
63-
current="$(grep '^newrelic.license' /etc/php.d/newrelic.ini | sed 's/.*=\s*"\(.*\)"\s*$/\1/')"
64-
65-
echo "$current"
66-
}
67-
6849
feature::update() {
6950
local value=$1
70-
local license=$2
51+
local config
7152

7253
echo "Setting newrelic apm to $value"
7354
sed -i -e "s/newrelic.enabled[[:space:]]=[[:space:]].*/newrelic.enabled = ${value}/" /etc/php.d/newrelic.ini
74-
sed -i -e "s/newrelic.license[[:space:]]=[[:space:]].*/newrelic.license = \"${license}\"/" /etc/php.d/newrelic.ini
7555
echo "Reloading php-fpm"
7656
systemctl reload php-fpm
7757
}

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

-3
This file was deleted.

0 commit comments

Comments
 (0)