2015-05-18 68 views
0

我目前正在尝试在Amazon Linux EC2服务器上安装软件包。我正在尝试使用ebextensions文件来设置yum-cron来每天查找软件包更新,但我相当确信我没有正确执行。通过ebextensions更新yum-cron软件包?

下面是我的config文件中的代码:

commands: 
01do_update_yum: 
    command: yum -y update 

02install_clamAV: 
    command: yum -y install clamav clamd 

03install_yum_cron: 
    command: yum -y install yum-cron 

04install_gedit: 
    command: yum -y install gedit 

05set_crontab_daily_update: 
    command: -c "gedit /etc/yum/yum-cron.conf" 

06change_apply_updates: 
    command: apply_updates = yes 

除非我失去了一些东西,第4-6步都不会不运行它们的用户(我)的工作。基本上,我想知道的是,如果有人知道我可以做我想做的事情,但在我的.config文件。

非常感谢! -Matt

回答

0

您需要更改脚本,以便第一行显示container_commands

下面是一个例子,我与我们建立部署:

container_commands: yum_update: command: yum update -y ignoreErrors: true install_mysql: command: yum install -y mysql install_mlocate: command: yum install -y mlocate ignoreErrors: true update_db: command: updatedb ignoreErrors: true install_expect: command: yum install -y expect

参见这个例子从AWS docs

container_commands: collectstatic: command: "django-admin.py collectstatic --noinput" 01syncdb: command: "django-admin.py syncdb --noinput" leader_only: true 02migrate: command: "django-admin.py migrate" leader_only: true 99customize: command: "scripts/customize.sh"

片断