Skip to content

Commit c81b013

Browse files
authored
Merge pull request #45 from aws-samples/fix-missing-cronjob
Fix missing cronjob
2 parents af1474a + c3aef3f commit c81b013

File tree

2 files changed

+21
-18
lines changed

2 files changed

+21
-18
lines changed

templates/03-pipelinehelper.yaml

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -634,32 +634,20 @@ Resources:
634634
sudo yum install -y php-pecl-memcached
635635
sudo yum remove -y php-pecl-memcached
636636
sudo yum install -y php-redis
637-
637+
sudo yum install -y openssl11
638638

639639
if [ $(uname -a | grep -c x86_64) == "1" ]; then
640640
echo "downloading x86 client for ElastiCache"
641-
wget -P /tmp/ https://elasticache-downloads.s3.amazonaws.com/ClusterClient/PHP-8.0/latest-64bit-X86-openssl3
642-
tar -xf '/tmp/latest-64bit-X86-openssl3'
641+
wget -P /tmp/ https://elasticache-downloads.s3.amazonaws.com/ClusterClient/PHP-8.0/latest-64bit-X86-openssl1.1
642+
tar -xf '/tmp/latest-64bit-X86-openssl1.1'
643643
else
644644
echo "downloading ARM-64 client for ElastiCache"
645-
wget -P /tmp/ https://elasticache-downloads.s3.amazonaws.com/ClusterClient/PHP-8.0/latest-64bit-arm-openssl3
646-
tar -xf '/tmp/latest-64bit-arm-openssl3'
645+
wget -P /tmp/ https://elasticache-downloads.s3.amazonaws.com/ClusterClient/PHP-8.0/latest-64bit-arm-openssl1.1
646+
tar -xf '/tmp/latest-64bit-arm-openssl1.1'
647647
fi
648648

649649
cp 'amazon-elasticache-cluster-client.so' /usr/lib64/php/modules/
650-
if [ ! -f /etc/php.d/50-memcached.ini ]; then
651-
touch /etc/php.d/50-memcached.ini
652-
fi
653-
echo 'extension=/usr/lib64/php/modules/amazon-elasticache-cluster-client.so;' >> /etc/php.d/50-memcached.ini
654-
echo 'extension=igbinary.so;' >> /etc/php.d/50-memcached.ini
655-
656-
if [ ! -f /etc/php.d/20-redis.ini ]; then
657-
touch /etc/php.d/20-redis.ini
658-
fi
659-
echo 'extension=/usr/lib64/php/modules/amazon-elasticache-cluster-client.so;' >> /etc/php.d/20-redis.ini
660-
echo 'extension=igbinary.so;' >> /etc/php.d/20-redis.ini
661-
662-
650+
echo 'extension=amazon-elasticache-cluster-client.so;' > /etc/php.d/50-elasticache.ini
663651
mode: 000500
664652
owner: root
665653
group: root

templates/04-web.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,7 @@ Resources:
333333
- install_codedeploy
334334
- install_webserver
335335
- start_webserver
336+
- add_crontab
336337
install_logs:
337338
packages:
338339
yum:
@@ -470,6 +471,20 @@ Resources:
470471
httpd:
471472
enabled: true
472473
ensureRunning: true
474+
add_crontab:
475+
files:
476+
/tmp/add_crontab.sh:
477+
content: !Sub |
478+
#!/bin/sh -xe
479+
echo "* * * * * apache /usr/bin/php /var/www/moodle/html/admin/cli/cron.php" > /etc/cron.d/moodle
480+
mode: 000500
481+
owner: root
482+
group: root
483+
commands:
484+
add_crontab:
485+
command: ./add_crontab.sh
486+
cwd: /tmp
487+
ignoreErrors: false
473488
Properties:
474489
LaunchTemplateData:
475490
BlockDeviceMappings:

0 commit comments

Comments
 (0)