Re: [packer] Cannot install crontab using shell provisioner on an EC2 instance

2017-08-11 Thread Stan Svec
I'll do it as you suggest. Thanks.

On Thursday, 10 August 2017 20:15:13 UTC+1, Rickard von Essen wrote:
>
> Just drop your cronfile into /etc/cron.d/ see 
> https://help.ubuntu.com/community/CronHowto#Two_Other_Types_of_Crontab
>
> On Aug 10, 2017 20:43, "Stan Svec" > 
> wrote:
>
>> I'm trying to install crontab on an AMI image using the shell provisioner 
>> like this:
>> {
>>   "type": "shell",
>>   "skip_clean": true,
>>   "inline": [
>> "some commands above and here and then..",
>> "(crontab -l 2> /dev/null; echo '0 03 * * * 
>> /home/ec2-user/cron/some-script.sh') | crontab -"
>>   ]
>> }
>> SSH username in the builder is set to *ec2-user*. The problem is that 
>> when I create an instance from the image and log in I cannot see any cron 
>> installed by checking with *crontab -l*. However when I keep the script 
>> on the image by setting *skip_clean* to *true* and execute the script 
>> again manually (as ec2-user) then the cron entry is set up. That seems 
>> strange to me, because all other commands in the inline sections execute 
>> just fine. Any thoughts please?
>>
>> Thanks,
>>
>> Stan
>>
>> -- 
>> This mailing list is governed under the HashiCorp Community Guidelines - 
>> https://www.hashicorp.com/community-guidelines.html. Behavior in 
>> violation of those guidelines may result in your removal from this mailing 
>> list.
>>  
>> GitHub Issues: https://github.com/mitchellh/packer/issues
>> IRC: #packer-tool on Freenode
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Packer" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to packer-tool...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/packer-tool/a630d63d-e6b2-4f93-96c2-d319f5ff1163%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
--- 
You received this message because you are subscribed to the Google Groups 
"Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to packer-tool+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/48676903-332a-40d2-8315-4bef0cd11849%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [packer] Cannot install crontab using shell provisioner on an EC2 instance

2017-08-10 Thread Rickard von Essen
Just drop your cronfile into /etc/cron.d/ see
https://help.ubuntu.com/community/CronHowto#Two_Other_Types_of_Crontab

On Aug 10, 2017 20:43, "Stan Svec"  wrote:

> I'm trying to install crontab on an AMI image using the shell provisioner
> like this:
> {
>   "type": "shell",
>   "skip_clean": true,
>   "inline": [
> "some commands above and here and then..",
> "(crontab -l 2> /dev/null; echo '0 03 * * * 
> /home/ec2-user/cron/some-script.sh')
> | crontab -"
>   ]
> }
> SSH username in the builder is set to *ec2-user*. The problem is that
> when I create an instance from the image and log in I cannot see any cron
> installed by checking with *crontab -l*. However when I keep the script
> on the image by setting *skip_clean* to *true* and execute the script
> again manually (as ec2-user) then the cron entry is set up. That seems
> strange to me, because all other commands in the inline sections execute
> just fine. Any thoughts please?
>
> Thanks,
>
> Stan
>
> --
> This mailing list is governed under the HashiCorp Community Guidelines -
> https://www.hashicorp.com/community-guidelines.html. Behavior in
> violation of those guidelines may result in your removal from this mailing
> list.
>
> GitHub Issues: https://github.com/mitchellh/packer/issues
> IRC: #packer-tool on Freenode
> ---
> You received this message because you are subscribed to the Google Groups
> "Packer" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to packer-tool+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/packer-tool/a630d63d-e6b2-4f93-96c2-d319f5ff1163%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
--- 
You received this message because you are subscribed to the Google Groups 
"Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to packer-tool+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt8aJgK0FEvPcUeKF1%2BJ4hkprrqMK_8QvDW%2B266cQ8rF%3Dg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[packer] Cannot install crontab using shell provisioner on an EC2 instance

2017-08-10 Thread Stan Svec
I'm trying to install crontab on an AMI image using the shell provisioner 
like this:
{
  "type": "shell",
  "skip_clean": true,
  "inline": [
"some commands above and here and then..",
"(crontab -l 2> /dev/null; echo '0 03 * * * 
/home/ec2-user/cron/some-script.sh') | crontab -"
  ]
}
SSH username in the builder is set to *ec2-user*. The problem is that when 
I create an instance from the image and log in I cannot see any cron 
installed by checking with *crontab -l*. However when I keep the script on 
the image by setting *skip_clean* to *true* and execute the script again 
manually (as ec2-user) then the cron entry is set up. That seems strange to 
me, because all other commands in the inline sections execute just fine. 
Any thoughts please?

Thanks,

Stan

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
--- 
You received this message because you are subscribed to the Google Groups 
"Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to packer-tool+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/a630d63d-e6b2-4f93-96c2-d319f5ff1163%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.