Skip to content

Commit

Permalink
Merge pull request #27 from tgpadua/master
Browse files Browse the repository at this point in the history
fix: replaced EFS mount commands by /etc/fstab to avoid issues on instances reboot
  • Loading branch information
dgomesbr authored Jan 21, 2022
2 parents 7417b51 + e0db9f7 commit 3506ec6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions templates/04-web.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -767,9 +767,10 @@ Resources:
mkdir -p /var/www/moodle/local

#Mount shared storage
mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2 ${ElasticFileSystem}.efs.${AWS::Region}.amazonaws.com:/data /var/www/moodle/data
mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2 ${ElasticFileSystem}.efs.${AWS::Region}.amazonaws.com:/cache /var/www/moodle/cache
mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2 ${ElasticFileSystem}.efs.${AWS::Region}.amazonaws.com:/temp /var/www/moodle/temp
echo "${ElasticFileSystem}.efs.${AWS::Region}.amazonaws.com:/data /var/www/moodle/data nfs4 nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2 0 0" >> /etc/fstab
echo "${ElasticFileSystem}.efs.${AWS::Region}.amazonaws.com:/cache /var/www/moodle/cache nfs4 nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2 0 0" >> /etc/fstab
echo "${ElasticFileSystem}.efs.${AWS::Region}.amazonaws.com:/temp /var/www/moodle/temp nfs4 nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2 0 0" >> /etc/fstab
mount -a

#Run CloudFormation Init Scripts
/opt/aws/bin/cfn-init --configsets deploy_webserver --verbose --stack ${AWS::StackName} --resource WebLaunchConfiguration --region ${AWS::Region}
Expand Down

0 comments on commit 3506ec6

Please sign in to comment.