# 

**URL:** <https://discourse.chef.io/t/topic/5589>\
**Category:** Chef Infra (archive)\
**Created:** [July 31, 2014, 5:55pm UTC](https://discourse.chef.io/t/topic/5589 "2014-07-31T17:55:52Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nikhil\_Shah](https://avatars.discourse-cdn.com/v4/letter/n/f17d59/32.png) [@Nikhil\_Shah](https://discourse.chef.io/u/Nikhil_Shah)\
**Post date:** [July 31, 2014, 5:55pm UTC](https://discourse.chef.io/t/topic/5589/1 "2014-07-31T17:55:52Z")

</div>

how have others accomplished this:

I just created a wrapper recipe that calls a script that runs a few custom  
stuff. Here is the cookbook:

cookbook\_file "/tmp/ffmeg.sh" _do_

source "ffmeg.sh"

mode 0755

_end_

execute "install ffmeg" _do_

command "sh /tmp/ffmeg.sh"

_end_

However, I keep getting:

Error executing action `run` on resource 'execute[install ffmeg]'

STDERR: sudo: sorry, you must have a tty to run sudo

How do I go around this if the server is unknown (EC2 instance)?

--  
_Nikhil Shah_ • _System Administrator_  
[nshah@theorchard.com](mailto:nshah@theorchard.com) • _p._ (+1) 212 308-5648

THE ORCHARD _Distribution Done Right_  
23 E 4th St Fl 3, New York, NY 10003

> **[The Orchard - Distribution Done Right](https://www.theorchard.com)**
>
> The Orchard is a pioneering music, film and video distribution company operating in more than 25 global markets.

_Follow us:_ The Daily Rind [http://www.dailyrindblog.com/](http://www.dailyrindblog.com/) • Facebook  
[http://www.facebook.com/theorchard](http://www.facebook.com/theorchard) • Twitter  
[http://www.twitter.com/orchtweets](http://www.twitter.com/orchtweets) • YouTube  
[http://www.youtube.com/user/theorchard](http://www.youtube.com/user/theorchard) • LinkedIn  
[http://www.linkedin.com/company/the-orchard](http://www.linkedin.com/company/the-orchard)

_Privileged And Confidential Communication._ This electronic transmission,  
and any documents attached hereto, (a) are protected by the Electronic  
Communications Privacy Act (18 USC §§ 2510-2521), (b) may contain  
confidential and/or legally privileged information, and (c) are for the  
sole use of the intended recipient named above. If you have received this  
electronic message in error, please notify the sender and delete the  
electronic message. Any disclosure, copying, distribution, or use of the  
contents of the information received in error is strictly prohibited.

---

<div class="post-metadata">

**Author:** ![Marco\_Betti](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/marco_betti/32/105_2.png) [@Marco\_Betti](https://discourse.chef.io/u/Marco_Betti)\
**Post date:** [July 31, 2014, 7:34pm UTC](https://discourse.chef.io/t/topic/5589/2 "2014-07-31T19:34:15Z")

</div>

This is typical for rhel family os, as amazon linux ami are.

The solution is to comment "Default requiretty" line within /etc/sudoers.

You could simply try using Chef::Util::FileEdit search\_file\_replace method  
in your recipe ([Class: Chef::Util::FileEdit — Documentation for chef (18.3.0)](http://rubydoc.info/gems/chef/Chef/Util/FileEdit)) to  
comment that line before other configurations.

Cheers,  
Marco

On Thu, Jul 31, 2014 at 7:55 PM, Nikhil Shah [nshah@theorchard.com](mailto:nshah@theorchard.com) wrote:

> how have others accomplished this:
> 
> I just created a wrapper recipe that calls a script that runs a few custom  
> stuff. Here is the cookbook:
> 
> cookbook\_file "/tmp/ffmeg.sh" _do_
> 
> source "ffmeg.sh"
> 
> mode 0755
> 
> _end_
> 
> execute "install ffmeg" _do_
> 
> command "sh /tmp/ffmeg.sh"
> 
> _end_
> 
> However, I keep getting:
> 
> Error executing action `run` on resource 'execute[install ffmeg]'
> 
> STDERR: sudo: sorry, you must have a tty to run sudo
> 
> How do I go around this if the server is unknown (EC2 instance)?
> 
> --  
> _Nikhil Shah_ • _System Administrator_  
> [nshah@theorchard.com](mailto:nshah@theorchard.com) • _p._ (+1) 212 308-5648
> 
> THE ORCHARD _Distribution Done Right_  
> 23 E 4th St Fl 3, New York, NY 10003  
> [www.theorchard.com](http://www.theorchard.com)
> 
> _Follow us:_ The Daily Rind [http://www.dailyrindblog.com/](http://www.dailyrindblog.com/) • Facebook  
> [http://www.facebook.com/theorchard](http://www.facebook.com/theorchard) • Twitter  
> [http://www.twitter.com/orchtweets](http://www.twitter.com/orchtweets) • YouTube  
> [http://www.youtube.com/user/theorchard](http://www.youtube.com/user/theorchard) • LinkedIn  
> [http://www.linkedin.com/company/the-orchard](http://www.linkedin.com/company/the-orchard)
> 
> _Privileged And Confidential Communication._ This electronic  
> transmission, and any documents attached hereto, (a) are protected by the  
> Electronic Communications Privacy Act (18 USC §§ 2510-2521), (b) may  
> contain confidential and/or legally privileged information, and (c) are for  
> the sole use of the intended recipient named above. If you have received  
> this electronic message in error, please notify the sender and delete the  
> electronic message. Any disclosure, copying, distribution, or use of the  
> contents of the information received in error is strictly prohibited.

--  
Ing. Marco Betti  
RHCE RHEL4 id 804006512121056

---

<div class="post-metadata">

**Author:** ![Nikhil\_Shah](https://avatars.discourse-cdn.com/v4/letter/n/f17d59/32.png) [@Nikhil\_Shah](https://discourse.chef.io/u/Nikhil_Shah)\
**Post date:** [July 31, 2014, 7:42pm UTC](https://discourse.chef.io/t/topic/5589/3 "2014-07-31T19:42:20Z")

</div>

Yea, that's im used to is disabling the requiretty but creating an AWS  
instance, it's kind of hard to when the instance doesn't exist yet =).

I'll def. take a look at the FileEdit and see if I can get it working that  
way. Is there another preferred method of running a bash script?

On Thu, Jul 31, 2014 at 3:34 PM, Marco Betti [m.betti@gmail.com](mailto:m.betti@gmail.com) wrote:

> This is typical for rhel family os, as amazon linux ami are.
> 
> The solution is to comment "Default requiretty" line within /etc/sudoers.
> 
> You could simply try using Chef::Util::FileEdit search\_file\_replace method  
> in your recipe ([Class: Chef::Util::FileEdit — Documentation for chef (18.3.0)](http://rubydoc.info/gems/chef/Chef/Util/FileEdit)) to  
> comment that line before other configurations.
> 
> Cheers,  
> Marco
> 
> On Thu, Jul 31, 2014 at 7:55 PM, Nikhil Shah [nshah@theorchard.com](mailto:nshah@theorchard.com) wrote:
> 
> > how have others accomplished this:
> > 
> > I just created a wrapper recipe that calls a script that runs a few  
> > custom stuff. Here is the cookbook:
> > 
> > cookbook\_file "/tmp/ffmeg.sh" _do_
> > 
> > source "ffmeg.sh"
> > 
> > mode 0755
> > 
> > _end_
> > 
> > execute "install ffmeg" _do_
> > 
> > command "sh /tmp/ffmeg.sh"
> > 
> > _end_
> > 
> > However, I keep getting:
> > 
> > Error executing action `run` on resource 'execute[install ffmeg]'
> > 
> > STDERR: sudo: sorry, you must have a tty to run sudo
> > 
> > How do I go around this if the server is unknown (EC2 instance)?
> > 
> > --  
> > _Nikhil Shah_ • _System Administrator_  
> > [nshah@theorchard.com](mailto:nshah@theorchard.com) • _p._ (+1) 212 308-5648
> > 
> > THE ORCHARD _Distribution Done Right_  
> > 23 E 4th St Fl 3, New York, NY 10003  
> > [www.theorchard.com](http://www.theorchard.com)
> > 
> > _Follow us:_ The Daily Rind [http://www.dailyrindblog.com/](http://www.dailyrindblog.com/) • Facebook  
> > [http://www.facebook.com/theorchard](http://www.facebook.com/theorchard) • Twitter  
> > [http://www.twitter.com/orchtweets](http://www.twitter.com/orchtweets) • YouTube  
> > [http://www.youtube.com/user/theorchard](http://www.youtube.com/user/theorchard) • LinkedIn  
> > [http://www.linkedin.com/company/the-orchard](http://www.linkedin.com/company/the-orchard)
> > 
> > _Privileged And Confidential Communication._ This electronic  
> > transmission, and any documents attached hereto, (a) are protected by the  
> > Electronic Communications Privacy Act (18 USC §§ 2510-2521), (b) may  
> > contain confidential and/or legally privileged information, and (c) are for  
> > the sole use of the intended recipient named above. If you have received  
> > this electronic message in error, please notify the sender and delete the  
> > electronic message. Any disclosure, copying, distribution, or use of the  
> > contents of the information received in error is strictly prohibited.
> 
> --  
> Ing. Marco Betti  
> RHCE RHEL4 id 804006512121056

--  
_Nikhil Shah_ • _System Administrator_  
[nshah@theorchard.com](mailto:nshah@theorchard.com) • _p._ (+1) 212 308-5648

THE ORCHARD _Distribution Done Right_  
23 E 4th St Fl 3, New York, NY 10003

> **[The Orchard](https://www.theorchard.com/)**
>
> What started as a revolutionary music distribution company, continues to evolve but never loses sight of its main purpose: to empower creators to grow and adapt in the dynamic, global industry.

_Follow us:_ The Daily Rind [http://www.dailyrindblog.com/](http://www.dailyrindblog.com/) • Facebook  
[http://www.facebook.com/theorchard](http://www.facebook.com/theorchard) • Twitter  
[http://www.twitter.com/orchtweets](http://www.twitter.com/orchtweets) • YouTube  
[http://www.youtube.com/user/theorchard](http://www.youtube.com/user/theorchard) • LinkedIn  
[http://www.linkedin.com/company/the-orchard](http://www.linkedin.com/company/the-orchard)

_Privileged And Confidential Communication._ This electronic transmission,  
and any documents attached hereto, (a) are protected by the Electronic  
Communications Privacy Act (18 USC §§ 2510-2521), (b) may contain  
confidential and/or legally privileged information, and (c) are for the  
sole use of the intended recipient named above. If you have received this  
electronic message in error, please notify the sender and delete the  
electronic message. Any disclosure, copying, distribution, or use of the  
contents of the information received in error is strictly prohibited.

---

<div class="post-metadata">

**Author:** ![Nikhil\_Shah](https://avatars.discourse-cdn.com/v4/letter/n/f17d59/32.png) [@Nikhil\_Shah](https://discourse.chef.io/u/Nikhil_Shah)\
**Post date:** [July 31, 2014, 7:55pm UTC](https://discourse.chef.io/t/topic/5589/4 "2014-07-31T19:55:20Z")

</div>

would you be able to give an example of how I would use the FileEdit? I'm  
not too fond of regex esp with a mixture of ruby

On Thu, Jul 31, 2014 at 3:42 PM, Nikhil Shah [nshah@theorchard.com](mailto:nshah@theorchard.com) wrote:

> Yea, that's im used to is disabling the requiretty but creating an AWS  
> instance, it's kind of hard to when the instance doesn't exist yet =).
> 
> I'll def. take a look at the FileEdit and see if I can get it working that  
> way. Is there another preferred method of running a bash script?
> 
> On Thu, Jul 31, 2014 at 3:34 PM, Marco Betti [m.betti@gmail.com](mailto:m.betti@gmail.com) wrote:
> 
> > This is typical for rhel family os, as amazon linux ami are.
> > 
> > The solution is to comment "Default requiretty" line within /etc/sudoers.
> > 
> > You could simply try using Chef::Util::FileEdit search\_file\_replace  
> > method in your recipe ([Class: Chef::Util::FileEdit — Documentation for chef (18.3.0)](http://rubydoc.info/gems/chef/Chef/Util/FileEdit))  
> > to comment that line before other configurations.
> > 
> > Cheers,  
> > Marco
> > 
> > On Thu, Jul 31, 2014 at 7:55 PM, Nikhil Shah [nshah@theorchard.com](mailto:nshah@theorchard.com)  
> > wrote:
> > 
> > > how have others accomplished this:
> > > 
> > > I just created a wrapper recipe that calls a script that runs a few  
> > > custom stuff. Here is the cookbook:
> > > 
> > > cookbook\_file "/tmp/ffmeg.sh" _do_
> > > 
> > > source "ffmeg.sh"
> > > 
> > > mode 0755
> > > 
> > > _end_
> > > 
> > > execute "install ffmeg" _do_
> > > 
> > > command "sh /tmp/ffmeg.sh"
> > > 
> > > _end_
> > > 
> > > However, I keep getting:
> > > 
> > > Error executing action `run` on resource 'execute[install ffmeg]'
> > > 
> > > STDERR: sudo: sorry, you must have a tty to run sudo
> > > 
> > > How do I go around this if the server is unknown (EC2 instance)?
> > > 
> > > --  
> > > _Nikhil Shah_ • _System Administrator_  
> > > [nshah@theorchard.com](mailto:nshah@theorchard.com) • _p._ (+1) 212 308-5648
> > > 
> > > THE ORCHARD _Distribution Done Right_  
> > > 23 E 4th St Fl 3, New York, NY 10003  
> > > [www.theorchard.com](http://www.theorchard.com)
> > > 
> > > _Follow us:_ The Daily Rind [http://www.dailyrindblog.com/](http://www.dailyrindblog.com/) • Facebook  
> > > [http://www.facebook.com/theorchard](http://www.facebook.com/theorchard) • Twitter  
> > > [http://www.twitter.com/orchtweets](http://www.twitter.com/orchtweets) • YouTube  
> > > [http://www.youtube.com/user/theorchard](http://www.youtube.com/user/theorchard) • LinkedIn  
> > > [http://www.linkedin.com/company/the-orchard](http://www.linkedin.com/company/the-orchard)
> > > 
> > > _Privileged And Confidential Communication._ This electronic  
> > > transmission, and any documents attached hereto, (a) are protected by the  
> > > Electronic Communications Privacy Act (18 USC §§ 2510-2521), (b) may  
> > > contain confidential and/or legally privileged information, and (c) are for  
> > > the sole use of the intended recipient named above. If you have received  
> > > this electronic message in error, please notify the sender and delete the  
> > > electronic message. Any disclosure, copying, distribution, or use of the  
> > > contents of the information received in error is strictly prohibited.
> > 
> > --  
> > Ing. Marco Betti  
> > RHCE RHEL4 id 804006512121056
> 
> --  
> _Nikhil Shah_ • _System Administrator_  
> [nshah@theorchard.com](mailto:nshah@theorchard.com) • _p._ (+1) 212 308-5648
> 
> THE ORCHARD _Distribution Done Right_  
> 23 E 4th St Fl 3, New York, NY 10003  
> [www.theorchard.com](http://www.theorchard.com)
> 
> _Follow us:_ The Daily Rind [http://www.dailyrindblog.com/](http://www.dailyrindblog.com/) • Facebook  
> [http://www.facebook.com/theorchard](http://www.facebook.com/theorchard) • Twitter  
> [http://www.twitter.com/orchtweets](http://www.twitter.com/orchtweets) • YouTube  
> [http://www.youtube.com/user/theorchard](http://www.youtube.com/user/theorchard) • LinkedIn  
> [http://www.linkedin.com/company/the-orchard](http://www.linkedin.com/company/the-orchard)
> 
> _Privileged And Confidential Communication._ This electronic  
> transmission, and any documents attached hereto, (a) are protected by the  
> Electronic Communications Privacy Act (18 USC §§ 2510-2521), (b) may  
> contain confidential and/or legally privileged information, and (c) are for  
> the sole use of the intended recipient named above. If you have received  
> this electronic message in error, please notify the sender and delete the  
> electronic message. Any disclosure, copying, distribution, or use of the  
> contents of the information received in error is strictly prohibited.

--  
_Nikhil Shah_ • _System Administrator_  
[nshah@theorchard.com](mailto:nshah@theorchard.com) • _p._ (+1) 212 308-5648

THE ORCHARD _Distribution Done Right_  
23 E 4th St Fl 3, New York, NY 10003

> **[The Orchard](https://www.theorchard.com/)**
>
> What started as a revolutionary music distribution company, continues to evolve but never loses sight of its main purpose: to empower creators to grow and adapt in the dynamic, global industry.

_Follow us:_ The Daily Rind [http://www.dailyrindblog.com/](http://www.dailyrindblog.com/) • Facebook  
[http://www.facebook.com/theorchard](http://www.facebook.com/theorchard) • Twitter  
[http://www.twitter.com/orchtweets](http://www.twitter.com/orchtweets) • YouTube  
[http://www.youtube.com/user/theorchard](http://www.youtube.com/user/theorchard) • LinkedIn  
[http://www.linkedin.com/company/the-orchard](http://www.linkedin.com/company/the-orchard)

_Privileged And Confidential Communication._ This electronic transmission,  
and any documents attached hereto, (a) are protected by the Electronic  
Communications Privacy Act (18 USC §§ 2510-2521), (b) may contain  
confidential and/or legally privileged information, and (c) are for the  
sole use of the intended recipient named above. If you have received this  
electronic message in error, please notify the sender and delete the  
electronic message. Any disclosure, copying, distribution, or use of the  
contents of the information received in error is strictly prohibited.

---

<div class="post-metadata">

**Author:** ![Marco\_Betti](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/marco_betti/32/105_2.png) [@Marco\_Betti](https://discourse.chef.io/u/Marco_Betti)\
**Post date:** [July 31, 2014, 8:04pm UTC](https://discourse.chef.io/t/topic/5589/5 "2014-07-31T20:04:35Z")

</div>

I can do it tomorrow morning, now it's 10 PM here and I left my mac at the  
office, sorry 🙂

Marco

On Thu, Jul 31, 2014 at 9:55 PM, Nikhil Shah [nshah@theorchard.com](mailto:nshah@theorchard.com) wrote:

> would you be able to give an example of how I would use the FileEdit? I'm  
> not too fond of regex esp with a mixture of ruby
> 
> On Thu, Jul 31, 2014 at 3:42 PM, Nikhil Shah [nshah@theorchard.com](mailto:nshah@theorchard.com) wrote:
> 
> > Yea, that's im used to is disabling the requiretty but creating an AWS  
> > instance, it's kind of hard to when the instance doesn't exist yet =).
> > 
> > I'll def. take a look at the FileEdit and see if I can get it working  
> > that way. Is there another preferred method of running a bash script?
> > 
> > On Thu, Jul 31, 2014 at 3:34 PM, Marco Betti [m.betti@gmail.com](mailto:m.betti@gmail.com) wrote:
> > 
> > > This is typical for rhel family os, as amazon linux ami are.
> > > 
> > > The solution is to comment "Default requiretty" line within /etc/sudoers.
> > > 
> > > You could simply try using Chef::Util::FileEdit search\_file\_replace  
> > > method in your recipe ([Class: Chef::Util::FileEdit — Documentation for chef (18.3.0)](http://rubydoc.info/gems/chef/Chef/Util/FileEdit))  
> > > to comment that line before other configurations.
> > > 
> > > Cheers,  
> > > Marco
> > > 
> > > On Thu, Jul 31, 2014 at 7:55 PM, Nikhil Shah [nshah@theorchard.com](mailto:nshah@theorchard.com)  
> > > wrote:
> > > 
> > > > how have others accomplished this:
> > > > 
> > > > I just created a wrapper recipe that calls a script that runs a few  
> > > > custom stuff. Here is the cookbook:
> > > > 
> > > > cookbook\_file "/tmp/ffmeg.sh" _do_
> > > > 
> > > > source "ffmeg.sh"
> > > > 
> > > > mode 0755
> > > > 
> > > > _end_
> > > > 
> > > > execute "install ffmeg" _do_
> > > > 
> > > > command "sh /tmp/ffmeg.sh"
> > > > 
> > > > _end_
> > > > 
> > > > However, I keep getting:
> > > > 
> > > > Error executing action `run` on resource 'execute[install ffmeg]'
> > > > 
> > > > STDERR: sudo: sorry, you must have a tty to run sudo
> > > > 
> > > > How do I go around this if the server is unknown (EC2 instance)?
> > > > 
> > > > --  
> > > > _Nikhil Shah_ • _System Administrator_  
> > > > [nshah@theorchard.com](mailto:nshah@theorchard.com) • _p._ (+1) 212 308-5648
> > > > 
> > > > THE ORCHARD _Distribution Done Right_  
> > > > 23 E 4th St Fl 3, New York, NY 10003  
> > > > [www.theorchard.com](http://www.theorchard.com)
> > > > 
> > > > _Follow us:_ The Daily Rind [http://www.dailyrindblog.com/](http://www.dailyrindblog.com/) • Facebook  
> > > > [http://www.facebook.com/theorchard](http://www.facebook.com/theorchard) • Twitter  
> > > > [http://www.twitter.com/orchtweets](http://www.twitter.com/orchtweets) • YouTube  
> > > > [http://www.youtube.com/user/theorchard](http://www.youtube.com/user/theorchard) • LinkedIn  
> > > > [http://www.linkedin.com/company/the-orchard](http://www.linkedin.com/company/the-orchard)
> > > > 
> > > > _Privileged And Confidential Communication._ This electronic  
> > > > transmission, and any documents attached hereto, (a) are protected by the  
> > > > Electronic Communications Privacy Act (18 USC §§ 2510-2521), (b) may  
> > > > contain confidential and/or legally privileged information, and (c) are for  
> > > > the sole use of the intended recipient named above. If you have received  
> > > > this electronic message in error, please notify the sender and delete the  
> > > > electronic message. Any disclosure, copying, distribution, or use of the  
> > > > contents of the information received in error is strictly prohibited.
> > > 
> > > --  
> > > Ing. Marco Betti  
> > > RHCE RHEL4 id 804006512121056
> > 
> > --  
> > _Nikhil Shah_ • _System Administrator_  
> > [nshah@theorchard.com](mailto:nshah@theorchard.com) • _p._ (+1) 212 308-5648
> > 
> > THE ORCHARD _Distribution Done Right_  
> > 23 E 4th St Fl 3, New York, NY 10003  
> > [www.theorchard.com](http://www.theorchard.com)
> > 
> > _Follow us:_ The Daily Rind [http://www.dailyrindblog.com/](http://www.dailyrindblog.com/) • Facebook  
> > [http://www.facebook.com/theorchard](http://www.facebook.com/theorchard) • Twitter  
> > [http://www.twitter.com/orchtweets](http://www.twitter.com/orchtweets) • YouTube  
> > [http://www.youtube.com/user/theorchard](http://www.youtube.com/user/theorchard) • LinkedIn  
> > [http://www.linkedin.com/company/the-orchard](http://www.linkedin.com/company/the-orchard)
> > 
> > _Privileged And Confidential Communication._ This electronic  
> > transmission, and any documents attached hereto, (a) are protected by the  
> > Electronic Communications Privacy Act (18 USC §§ 2510-2521), (b) may  
> > contain confidential and/or legally privileged information, and (c) are for  
> > the sole use of the intended recipient named above. If you have received  
> > this electronic message in error, please notify the sender and delete the  
> > electronic message. Any disclosure, copying, distribution, or use of the  
> > contents of the information received in error is strictly prohibited.
> 
> --  
> _Nikhil Shah_ • _System Administrator_  
> [nshah@theorchard.com](mailto:nshah@theorchard.com) • _p._ (+1) 212 308-5648
> 
> THE ORCHARD _Distribution Done Right_  
> 23 E 4th St Fl 3, New York, NY 10003  
> [www.theorchard.com](http://www.theorchard.com)
> 
> _Follow us:_ The Daily Rind [http://www.dailyrindblog.com/](http://www.dailyrindblog.com/) • Facebook  
> [http://www.facebook.com/theorchard](http://www.facebook.com/theorchard) • Twitter  
> [http://www.twitter.com/orchtweets](http://www.twitter.com/orchtweets) • YouTube  
> [http://www.youtube.com/user/theorchard](http://www.youtube.com/user/theorchard) • LinkedIn  
> [http://www.linkedin.com/company/the-orchard](http://www.linkedin.com/company/the-orchard)
> 
> _Privileged And Confidential Communication._ This electronic  
> transmission, and any documents attached hereto, (a) are protected by the  
> Electronic Communications Privacy Act (18 USC §§ 2510-2521), (b) may  
> contain confidential and/or legally privileged information, and (c) are for  
> the sole use of the intended recipient named above. If you have received  
> this electronic message in error, please notify the sender and delete the  
> electronic message. Any disclosure, copying, distribution, or use of the  
> contents of the information received in error is strictly prohibited.

--  
Ing. Marco Betti  
RHCE RHEL4 id 804006512121056

---

<div class="post-metadata">

**Author:** ![Marco\_Betti](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/marco_betti/32/105_2.png) [@Marco\_Betti](https://discourse.chef.io/u/Marco_Betti)\
**Post date:** [July 31, 2014, 8:14pm UTC](https://discourse.chef.io/t/topic/5589/6 "2014-07-31T20:14:17Z")

</div>

If you give a look to:

> **[ruby\_block Resource](https://docs.chef.io/resources/ruby_block/)**
>
> Use the ruby\_block resource to execute Ruby code during a Chef Infra Client run. Ruby code in the ruby\_block resource is evaluated with other resources during convergence, whereas Ruby code outside of a ruby\_block resource is evaluated before other...

youl'll find an example ("Update the /etc/hosts file").

regex are the same as with sed, if you are used to it.

If yout put that ruby code within a ruby block it will be run during  
convergence phase, oherwise if you'll put it outside a ruby block it will  
be run during compile phase.

Marco

On Thu, Jul 31, 2014 at 10:04 PM, Marco Betti [m.betti@gmail.com](mailto:m.betti@gmail.com) wrote:

> I can do it tomorrow morning, now it's 10 PM here and I left my mac at the  
> office, sorry 🙂
> 
> Marco
> 
> On Thu, Jul 31, 2014 at 9:55 PM, Nikhil Shah [nshah@theorchard.com](mailto:nshah@theorchard.com) wrote:
> 
> > would you be able to give an example of how I would use the FileEdit? I'm  
> > not too fond of regex esp with a mixture of ruby
> > 
> > On Thu, Jul 31, 2014 at 3:42 PM, Nikhil Shah [nshah@theorchard.com](mailto:nshah@theorchard.com)  
> > wrote:
> > 
> > > Yea, that's im used to is disabling the requiretty but creating an AWS  
> > > instance, it's kind of hard to when the instance doesn't exist yet =).
> > > 
> > > I'll def. take a look at the FileEdit and see if I can get it working  
> > > that way. Is there another preferred method of running a bash script?
> > > 
> > > On Thu, Jul 31, 2014 at 3:34 PM, Marco Betti [m.betti@gmail.com](mailto:m.betti@gmail.com) wrote:
> > > 
> > > > This is typical for rhel family os, as amazon linux ami are.
> > > > 
> > > > The solution is to comment "Default requiretty" line within  
> > > > /etc/sudoers.
> > > > 
> > > > You could simply try using Chef::Util::FileEdit search\_file\_replace  
> > > > method in your recipe ([Class: Chef::Util::FileEdit — Documentation for chef (18.3.0)](http://rubydoc.info/gems/chef/Chef/Util/FileEdit))  
> > > > to comment that line before other configurations.
> > > > 
> > > > Cheers,  
> > > > Marco
> > > > 
> > > > On Thu, Jul 31, 2014 at 7:55 PM, Nikhil Shah [nshah@theorchard.com](mailto:nshah@theorchard.com)  
> > > > wrote:
> > > > 
> > > > > how have others accomplished this:
> > > > > 
> > > > > I just created a wrapper recipe that calls a script that runs a few  
> > > > > custom stuff. Here is the cookbook:
> > > > > 
> > > > > cookbook\_file "/tmp/ffmeg.sh" _do_
> > > > > 
> > > > > source "ffmeg.sh"
> > > > > 
> > > > > mode 0755
> > > > > 
> > > > > _end_
> > > > > 
> > > > > execute "install ffmeg" _do_
> > > > > 
> > > > > command "sh /tmp/ffmeg.sh"
> > > > > 
> > > > > _end_
> > > > > 
> > > > > However, I keep getting:
> > > > > 
> > > > > Error executing action `run` on resource 'execute[install ffmeg]'
> > > > > 
> > > > > STDERR: sudo: sorry, you must have a tty to run sudo
> > > > > 
> > > > > How do I go around this if the server is unknown (EC2 instance)?
> > > > > 
> > > > > --  
> > > > > _Nikhil Shah_ • _System Administrator_  
> > > > > [nshah@theorchard.com](mailto:nshah@theorchard.com) • _p._ (+1) 212 308-5648
> > > > > 
> > > > > THE ORCHARD _Distribution Done Right_  
> > > > > 23 E 4th St Fl 3, New York, NY 10003  
> > > > > [www.theorchard.com](http://www.theorchard.com)
> > > > > 
> > > > > _Follow us:_ The Daily Rind [http://www.dailyrindblog.com/](http://www.dailyrindblog.com/) • Facebook  
> > > > > [http://www.facebook.com/theorchard](http://www.facebook.com/theorchard) • Twitter  
> > > > > [http://www.twitter.com/orchtweets](http://www.twitter.com/orchtweets) • YouTube  
> > > > > [http://www.youtube.com/user/theorchard](http://www.youtube.com/user/theorchard) • LinkedIn  
> > > > > [http://www.linkedin.com/company/the-orchard](http://www.linkedin.com/company/the-orchard)
> > > > > 
> > > > > _Privileged And Confidential Communication._ This electronic  
> > > > > transmission, and any documents attached hereto, (a) are protected by the  
> > > > > Electronic Communications Privacy Act (18 USC §§ 2510-2521), (b) may  
> > > > > contain confidential and/or legally privileged information, and (c) are for  
> > > > > the sole use of the intended recipient named above. If you have received  
> > > > > this electronic message in error, please notify the sender and delete the  
> > > > > electronic message. Any disclosure, copying, distribution, or use of the  
> > > > > contents of the information received in error is strictly prohibited.
> > > > 
> > > > --  
> > > > Ing. Marco Betti  
> > > > RHCE RHEL4 id 804006512121056
> > > 
> > > --  
> > > _Nikhil Shah_ • _System Administrator_  
> > > [nshah@theorchard.com](mailto:nshah@theorchard.com) • _p._ (+1) 212 308-5648
> > > 
> > > THE ORCHARD _Distribution Done Right_  
> > > 23 E 4th St Fl 3, New York, NY 10003  
> > > [www.theorchard.com](http://www.theorchard.com)
> > > 
> > > _Follow us:_ The Daily Rind [http://www.dailyrindblog.com/](http://www.dailyrindblog.com/) • Facebook  
> > > [http://www.facebook.com/theorchard](http://www.facebook.com/theorchard) • Twitter  
> > > [http://www.twitter.com/orchtweets](http://www.twitter.com/orchtweets) • YouTube  
> > > [http://www.youtube.com/user/theorchard](http://www.youtube.com/user/theorchard) • LinkedIn  
> > > [http://www.linkedin.com/company/the-orchard](http://www.linkedin.com/company/the-orchard)
> > > 
> > > _Privileged And Confidential Communication._ This electronic  
> > > transmission, and any documents attached hereto, (a) are protected by the  
> > > Electronic Communications Privacy Act (18 USC §§ 2510-2521), (b) may  
> > > contain confidential and/or legally privileged information, and (c) are for  
> > > the sole use of the intended recipient named above. If you have received  
> > > this electronic message in error, please notify the sender and delete the  
> > > electronic message. Any disclosure, copying, distribution, or use of the  
> > > contents of the information received in error is strictly prohibited.
> > 
> > --  
> > _Nikhil Shah_ • _System Administrator_  
> > [nshah@theorchard.com](mailto:nshah@theorchard.com) • _p._ (+1) 212 308-5648
> > 
> > THE ORCHARD _Distribution Done Right_  
> > 23 E 4th St Fl 3, New York, NY 10003  
> > [www.theorchard.com](http://www.theorchard.com)
> > 
> > _Follow us:_ The Daily Rind [http://www.dailyrindblog.com/](http://www.dailyrindblog.com/) • Facebook  
> > [http://www.facebook.com/theorchard](http://www.facebook.com/theorchard) • Twitter  
> > [http://www.twitter.com/orchtweets](http://www.twitter.com/orchtweets) • YouTube  
> > [http://www.youtube.com/user/theorchard](http://www.youtube.com/user/theorchard) • LinkedIn  
> > [http://www.linkedin.com/company/the-orchard](http://www.linkedin.com/company/the-orchard)
> > 
> > _Privileged And Confidential Communication._ This electronic  
> > transmission, and any documents attached hereto, (a) are protected by the  
> > Electronic Communications Privacy Act (18 USC §§ 2510-2521), (b) may  
> > contain confidential and/or legally privileged information, and (c) are for  
> > the sole use of the intended recipient named above. If you have received  
> > this electronic message in error, please notify the sender and delete the  
> > electronic message. Any disclosure, copying, distribution, or use of the  
> > contents of the information received in error is strictly prohibited.
> 
> --  
> Ing. Marco Betti  
> RHCE RHEL4 id 804006512121056

--  
Ing. Marco Betti  
RHCE RHEL4 id 804006512121056

---

<div class="post-metadata">

**Author:** ![Nikhil\_Shah](https://avatars.discourse-cdn.com/v4/letter/n/f17d59/32.png) [@Nikhil\_Shah](https://discourse.chef.io/u/Nikhil_Shah)\
**Post date:** [July 31, 2014, 9:27pm UTC](https://discourse.chef.io/t/topic/5589/7 "2014-07-31T21:27:07Z")

</div>

@Marco,

Would I be able to add this to my existing execute recipe:

ruby\_block "edit sudoers" do

block do

```
rc = Chef::Util::FileEdit.new("/etc/sudoers")

rc.search_file_replace_line(/^Defaults\s+requiretty/,

   "#Defaults\trequiretty")

rc.write_file

```

end

end

cookbook\_file "/tmp/ffmeg.sh" _do_

source "ffmeg.sh"

mode 0755

_end_

execute "install ffmeg" _do_

command "sh /tmp/ffmeg.sh"

_end_

On Thu, Jul 31, 2014 at 4:14 PM, Marco Betti [m.betti@gmail.com](mailto:m.betti@gmail.com) wrote:

> If you give a look to:  
> [ruby\_block Resource](http://docs.getchef.com/resource_ruby_block.html)  
> youl'll find an example ("Update the /etc/hosts file").
> 
> regex are the same as with sed, if you are used to it.
> 
> If yout put that ruby code within a ruby block it will be run during  
> convergence phase, oherwise if you'll put it outside a ruby block it will  
> be run during compile phase.
> 
> Marco
> 
> On Thu, Jul 31, 2014 at 10:04 PM, Marco Betti [m.betti@gmail.com](mailto:m.betti@gmail.com) wrote:
> 
> > I can do it tomorrow morning, now it's 10 PM here and I left my mac at  
> > the office, sorry 🙂
> > 
> > Marco
> > 
> > On Thu, Jul 31, 2014 at 9:55 PM, Nikhil Shah [nshah@theorchard.com](mailto:nshah@theorchard.com)  
> > wrote:
> > 
> > > would you be able to give an example of how I would use the FileEdit?  
> > > I'm not too fond of regex esp with a mixture of ruby
> > > 
> > > On Thu, Jul 31, 2014 at 3:42 PM, Nikhil Shah [nshah@theorchard.com](mailto:nshah@theorchard.com)  
> > > wrote:
> > > 
> > > > Yea, that's im used to is disabling the requiretty but creating an AWS  
> > > > instance, it's kind of hard to when the instance doesn't exist yet =).
> > > > 
> > > > I'll def. take a look at the FileEdit and see if I can get it working  
> > > > that way. Is there another preferred method of running a bash script?
> > > > 
> > > > On Thu, Jul 31, 2014 at 3:34 PM, Marco Betti [m.betti@gmail.com](mailto:m.betti@gmail.com) wrote:
> > > > 
> > > > > This is typical for rhel family os, as amazon linux ami are.
> > > > > 
> > > > > The solution is to comment "Default requiretty" line within  
> > > > > /etc/sudoers.
> > > > > 
> > > > > You could simply try using Chef::Util::FileEdit search\_file\_replace  
> > > > > method in your recipe (  
> > > > > [Class: Chef::Util::FileEdit — Documentation for chef (18.3.0)](http://rubydoc.info/gems/chef/Chef/Util/FileEdit)) to comment that  
> > > > > line before other configurations.
> > > > > 
> > > > > Cheers,  
> > > > > Marco
> > > > > 
> > > > > On Thu, Jul 31, 2014 at 7:55 PM, Nikhil Shah [nshah@theorchard.com](mailto:nshah@theorchard.com)  
> > > > > wrote:
> > > > > 
> > > > > > how have others accomplished this:
> > > > > > 
> > > > > > I just created a wrapper recipe that calls a script that runs a few  
> > > > > > custom stuff. Here is the cookbook:
> > > > > > 
> > > > > > cookbook\_file "/tmp/ffmeg.sh" _do_
> > > > > > 
> > > > > > source "ffmeg.sh"
> > > > > > 
> > > > > > mode 0755
> > > > > > 
> > > > > > _end_
> > > > > > 
> > > > > > execute "install ffmeg" _do_
> > > > > > 
> > > > > > command "sh /tmp/ffmeg.sh"
> > > > > > 
> > > > > > _end_
> > > > > > 
> > > > > > However, I keep getting:
> > > > > > 
> > > > > > Error executing action `run` on resource 'execute[install ffmeg]'
> > > > > > 
> > > > > > STDERR: sudo: sorry, you must have a tty to run sudo
> > > > > > 
> > > > > > How do I go around this if the server is unknown (EC2 instance)?
> > > > > > 
> > > > > > --  
> > > > > > _Nikhil Shah_ • _System Administrator_  
> > > > > > [nshah@theorchard.com](mailto:nshah@theorchard.com) • _p._ (+1) 212 308-5648
> > > > > > 
> > > > > > THE ORCHARD _Distribution Done Right_  
> > > > > > 23 E 4th St Fl 3, New York, NY 10003  
> > > > > > [www.theorchard.com](http://www.theorchard.com)
> > > > > > 
> > > > > > _Follow us:_ The Daily Rind [http://www.dailyrindblog.com/](http://www.dailyrindblog.com/) •  
> > > > > > Facebook [http://www.facebook.com/theorchard](http://www.facebook.com/theorchard) • Twitter  
> > > > > > [http://www.twitter.com/orchtweets](http://www.twitter.com/orchtweets) • YouTube  
> > > > > > [http://www.youtube.com/user/theorchard](http://www.youtube.com/user/theorchard) • LinkedIn  
> > > > > > [http://www.linkedin.com/company/the-orchard](http://www.linkedin.com/company/the-orchard)
> > > > > > 
> > > > > > _Privileged And Confidential Communication._ This electronic  
> > > > > > transmission, and any documents attached hereto, (a) are protected by the  
> > > > > > Electronic Communications Privacy Act (18 USC §§ 2510-2521), (b) may  
> > > > > > contain confidential and/or legally privileged information, and (c) are for  
> > > > > > the sole use of the intended recipient named above. If you have received  
> > > > > > this electronic message in error, please notify the sender and delete the  
> > > > > > electronic message. Any disclosure, copying, distribution, or use of the  
> > > > > > contents of the information received in error is strictly prohibited.
> > > > > 
> > > > > --  
> > > > > Ing. Marco Betti  
> > > > > RHCE RHEL4 id 804006512121056
> > > > 
> > > > --  
> > > > _Nikhil Shah_ • _System Administrator_  
> > > > [nshah@theorchard.com](mailto:nshah@theorchard.com) • _p._ (+1) 212 308-5648
> > > > 
> > > > THE ORCHARD _Distribution Done Right_  
> > > > 23 E 4th St Fl 3, New York, NY 10003  
> > > > [www.theorchard.com](http://www.theorchard.com)
> > > > 
> > > > _Follow us:_ The Daily Rind [http://www.dailyrindblog.com/](http://www.dailyrindblog.com/) • Facebook  
> > > > [http://www.facebook.com/theorchard](http://www.facebook.com/theorchard) • Twitter  
> > > > [http://www.twitter.com/orchtweets](http://www.twitter.com/orchtweets) • YouTube  
> > > > [http://www.youtube.com/user/theorchard](http://www.youtube.com/user/theorchard) • LinkedIn  
> > > > [http://www.linkedin.com/company/the-orchard](http://www.linkedin.com/company/the-orchard)
> > > > 
> > > > _Privileged And Confidential Communication._ This electronic  
> > > > transmission, and any documents attached hereto, (a) are protected by the  
> > > > Electronic Communications Privacy Act (18 USC §§ 2510-2521), (b) may  
> > > > contain confidential and/or legally privileged information, and (c) are for  
> > > > the sole use of the intended recipient named above. If you have received  
> > > > this electronic message in error, please notify the sender and delete the  
> > > > electronic message. Any disclosure, copying, distribution, or use of the  
> > > > contents of the information received in error is strictly prohibited.
> > > 
> > > --  
> > > _Nikhil Shah_ • _System Administrator_  
> > > [nshah@theorchard.com](mailto:nshah@theorchard.com) • _p._ (+1) 212 308-5648
> > > 
> > > THE ORCHARD _Distribution Done Right_  
> > > 23 E 4th St Fl 3, New York, NY 10003  
> > > [www.theorchard.com](http://www.theorchard.com)
> > > 
> > > _Follow us:_ The Daily Rind [http://www.dailyrindblog.com/](http://www.dailyrindblog.com/) • Facebook  
> > > [http://www.facebook.com/theorchard](http://www.facebook.com/theorchard) • Twitter  
> > > [http://www.twitter.com/orchtweets](http://www.twitter.com/orchtweets) • YouTube  
> > > [http://www.youtube.com/user/theorchard](http://www.youtube.com/user/theorchard) • LinkedIn  
> > > [http://www.linkedin.com/company/the-orchard](http://www.linkedin.com/company/the-orchard)
> > > 
> > > _Privileged And Confidential Communication._ This electronic  
> > > transmission, and any documents attached hereto, (a) are protected by the  
> > > Electronic Communications Privacy Act (18 USC §§ 2510-2521), (b) may  
> > > contain confidential and/or legally privileged information, and (c) are for  
> > > the sole use of the intended recipient named above. If you have received  
> > > this electronic message in error, please notify the sender and delete the  
> > > electronic message. Any disclosure, copying, distribution, or use of the  
> > > contents of the information received in error is strictly prohibited.
> > 
> > --  
> > Ing. Marco Betti  
> > RHCE RHEL4 id 804006512121056
> 
> --  
> Ing. Marco Betti  
> RHCE RHEL4 id 804006512121056

--  
_Nikhil Shah_ • _System Administrator_  
[nshah@theorchard.com](mailto:nshah@theorchard.com) • _p._ (+1) 212 308-5648

THE ORCHARD _Distribution Done Right_  
23 E 4th St Fl 3, New York, NY 10003

> **[The Orchard](https://www.theorchard.com/)**
>
> What started as a revolutionary music distribution company, continues to evolve but never loses sight of its main purpose: to empower creators to grow and adapt in the dynamic, global industry.

_Follow us:_ The Daily Rind [http://www.dailyrindblog.com/](http://www.dailyrindblog.com/) • Facebook  
[http://www.facebook.com/theorchard](http://www.facebook.com/theorchard) • Twitter  
[http://www.twitter.com/orchtweets](http://www.twitter.com/orchtweets) • YouTube  
[http://www.youtube.com/user/theorchard](http://www.youtube.com/user/theorchard) • LinkedIn  
[http://www.linkedin.com/company/the-orchard](http://www.linkedin.com/company/the-orchard)

_Privileged And Confidential Communication._ This electronic transmission,  
and any documents attached hereto, (a) are protected by the Electronic  
Communications Privacy Act (18 USC §§ 2510-2521), (b) may contain  
confidential and/or legally privileged information, and (c) are for the  
sole use of the intended recipient named above. If you have received this  
electronic message in error, please notify the sender and delete the  
electronic message. Any disclosure, copying, distribution, or use of the  
contents of the information received in error is strictly prohibited.

---

<div class="post-metadata">

**Author:** ![Nikhil\_Shah](https://avatars.discourse-cdn.com/v4/letter/n/f17d59/32.png) [@Nikhil\_Shah](https://discourse.chef.io/u/Nikhil_Shah)\
**Post date:** [July 31, 2014, 10:37pm UTC](https://discourse.chef.io/t/topic/5589/8 "2014-07-31T22:37:59Z")

</div>

Thank you all! The above actually did work.

On Thu, Jul 31, 2014 at 5:27 PM, Nikhil Shah [nshah@theorchard.com](mailto:nshah@theorchard.com) wrote:

> @Marco,
> 
> Would I be able to add this to my existing execute recipe:
> 
> ruby\_block "edit sudoers" do
> 
> block do
> 
> ```
> rc = Chef::Util::FileEdit.new("/etc/sudoers")
> 
> rc.search_file_replace_line(/^Defaults\s+requiretty/,
> 
> "#Defaults\trequiretty")
> 
> rc.write_file
> 
> ```
> 
> end
> 
> end
> 
> cookbook\_file "/tmp/ffmeg.sh" _do_
> 
> source "ffmeg.sh"
> 
> mode 0755
> 
> _end_
> 
> execute "install ffmeg" _do_
> 
> command "sh /tmp/ffmeg.sh"
> 
> _end_
> 
> On Thu, Jul 31, 2014 at 4:14 PM, Marco Betti [m.betti@gmail.com](mailto:m.betti@gmail.com) wrote:
> 
> > If you give a look to:  
> > [ruby\_block Resource](http://docs.getchef.com/resource_ruby_block.html)  
> > youl'll find an example ("Update the /etc/hosts file").
> > 
> > regex are the same as with sed, if you are used to it.
> > 
> > If yout put that ruby code within a ruby block it will be run during  
> > convergence phase, oherwise if you'll put it outside a ruby block it will  
> > be run during compile phase.
> > 
> > Marco
> > 
> > On Thu, Jul 31, 2014 at 10:04 PM, Marco Betti [m.betti@gmail.com](mailto:m.betti@gmail.com) wrote:
> > 
> > > I can do it tomorrow morning, now it's 10 PM here and I left my mac at  
> > > the office, sorry 🙂
> > > 
> > > Marco
> > > 
> > > On Thu, Jul 31, 2014 at 9:55 PM, Nikhil Shah [nshah@theorchard.com](mailto:nshah@theorchard.com)  
> > > wrote:
> > > 
> > > > would you be able to give an example of how I would use the FileEdit?  
> > > > I'm not too fond of regex esp with a mixture of ruby
> > > > 
> > > > On Thu, Jul 31, 2014 at 3:42 PM, Nikhil Shah [nshah@theorchard.com](mailto:nshah@theorchard.com)  
> > > > wrote:
> > > > 
> > > > > Yea, that's im used to is disabling the requiretty but creating an AWS  
> > > > > instance, it's kind of hard to when the instance doesn't exist yet =).
> > > > > 
> > > > > I'll def. take a look at the FileEdit and see if I can get it working  
> > > > > that way. Is there another preferred method of running a bash script?
> > > > > 
> > > > > On Thu, Jul 31, 2014 at 3:34 PM, Marco Betti [m.betti@gmail.com](mailto:m.betti@gmail.com)  
> > > > > wrote:
> > > > > 
> > > > > > This is typical for rhel family os, as amazon linux ami are.
> > > > > > 
> > > > > > The solution is to comment "Default requiretty" line within  
> > > > > > /etc/sudoers.
> > > > > > 
> > > > > > You could simply try using Chef::Util::FileEdit search\_file\_replace  
> > > > > > method in your recipe (  
> > > > > > [Class: Chef::Util::FileEdit — Documentation for chef (18.3.0)](http://rubydoc.info/gems/chef/Chef/Util/FileEdit)) to comment that  
> > > > > > line before other configurations.
> > > > > > 
> > > > > > Cheers,  
> > > > > > Marco
> > > > > > 
> > > > > > On Thu, Jul 31, 2014 at 7:55 PM, Nikhil Shah [nshah@theorchard.com](mailto:nshah@theorchard.com)  
> > > > > > wrote:
> > > > > > 
> > > > > > > how have others accomplished this:
> > > > > > > 
> > > > > > > I just created a wrapper recipe that calls a script that runs a few  
> > > > > > > custom stuff. Here is the cookbook:
> > > > > > > 
> > > > > > > cookbook\_file "/tmp/ffmeg.sh" _do_
> > > > > > > 
> > > > > > > source "ffmeg.sh"
> > > > > > > 
> > > > > > > mode 0755
> > > > > > > 
> > > > > > > _end_
> > > > > > > 
> > > > > > > execute "install ffmeg" _do_
> > > > > > > 
> > > > > > > command "sh /tmp/ffmeg.sh"
> > > > > > > 
> > > > > > > _end_
> > > > > > > 
> > > > > > > However, I keep getting:
> > > > > > > 
> > > > > > > Error executing action `run` on resource 'execute[install ffmeg]'
> > > > > > > 
> > > > > > > STDERR: sudo: sorry, you must have a tty to run sudo
> > > > > > > 
> > > > > > > How do I go around this if the server is unknown (EC2 instance)?
> > > > > > > 
> > > > > > > --  
> > > > > > > _Nikhil Shah_ • _System Administrator_  
> > > > > > > [nshah@theorchard.com](mailto:nshah@theorchard.com) • _p._ (+1) 212 308-5648
> > > > > > > 
> > > > > > > THE ORCHARD _Distribution Done Right_  
> > > > > > > 23 E 4th St Fl 3, New York, NY 10003  
> > > > > > > [www.theorchard.com](http://www.theorchard.com)
> > > > > > > 
> > > > > > > _Follow us:_ The Daily Rind [http://www.dailyrindblog.com/](http://www.dailyrindblog.com/) •  
> > > > > > > Facebook [http://www.facebook.com/theorchard](http://www.facebook.com/theorchard) • Twitter  
> > > > > > > [http://www.twitter.com/orchtweets](http://www.twitter.com/orchtweets) • YouTube  
> > > > > > > [http://www.youtube.com/user/theorchard](http://www.youtube.com/user/theorchard) • LinkedIn  
> > > > > > > [http://www.linkedin.com/company/the-orchard](http://www.linkedin.com/company/the-orchard)
> > > > > > > 
> > > > > > > _Privileged And Confidential Communication._ This electronic  
> > > > > > > transmission, and any documents attached hereto, (a) are protected by the  
> > > > > > > Electronic Communications Privacy Act (18 USC §§ 2510-2521), (b) may  
> > > > > > > contain confidential and/or legally privileged information, and (c) are for  
> > > > > > > the sole use of the intended recipient named above. If you have received  
> > > > > > > this electronic message in error, please notify the sender and delete the  
> > > > > > > electronic message. Any disclosure, copying, distribution, or use of the  
> > > > > > > contents of the information received in error is strictly prohibited.
> > > > > > 
> > > > > > --  
> > > > > > Ing. Marco Betti  
> > > > > > RHCE RHEL4 id 804006512121056
> > > > > 
> > > > > --  
> > > > > _Nikhil Shah_ • _System Administrator_  
> > > > > [nshah@theorchard.com](mailto:nshah@theorchard.com) • _p._ (+1) 212 308-5648
> > > > > 
> > > > > THE ORCHARD _Distribution Done Right_  
> > > > > 23 E 4th St Fl 3, New York, NY 10003  
> > > > > [www.theorchard.com](http://www.theorchard.com)
> > > > > 
> > > > > _Follow us:_ The Daily Rind [http://www.dailyrindblog.com/](http://www.dailyrindblog.com/) • Facebook  
> > > > > [http://www.facebook.com/theorchard](http://www.facebook.com/theorchard) • Twitter  
> > > > > [http://www.twitter.com/orchtweets](http://www.twitter.com/orchtweets) • YouTube  
> > > > > [http://www.youtube.com/user/theorchard](http://www.youtube.com/user/theorchard) • LinkedIn  
> > > > > [http://www.linkedin.com/company/the-orchard](http://www.linkedin.com/company/the-orchard)
> > > > > 
> > > > > _Privileged And Confidential Communication._ This electronic  
> > > > > transmission, and any documents attached hereto, (a) are protected by the  
> > > > > Electronic Communications Privacy Act (18 USC §§ 2510-2521), (b) may  
> > > > > contain confidential and/or legally privileged information, and (c) are for  
> > > > > the sole use of the intended recipient named above. If you have received  
> > > > > this electronic message in error, please notify the sender and delete the  
> > > > > electronic message. Any disclosure, copying, distribution, or use of the  
> > > > > contents of the information received in error is strictly prohibited.
> > > > 
> > > > --  
> > > > _Nikhil Shah_ • _System Administrator_  
> > > > [nshah@theorchard.com](mailto:nshah@theorchard.com) • _p._ (+1) 212 308-5648
> > > > 
> > > > THE ORCHARD _Distribution Done Right_  
> > > > 23 E 4th St Fl 3, New York, NY 10003  
> > > > [www.theorchard.com](http://www.theorchard.com)
> > > > 
> > > > _Follow us:_ The Daily Rind [http://www.dailyrindblog.com/](http://www.dailyrindblog.com/) • Facebook  
> > > > [http://www.facebook.com/theorchard](http://www.facebook.com/theorchard) • Twitter  
> > > > [http://www.twitter.com/orchtweets](http://www.twitter.com/orchtweets) • YouTube  
> > > > [http://www.youtube.com/user/theorchard](http://www.youtube.com/user/theorchard) • LinkedIn  
> > > > [http://www.linkedin.com/company/the-orchard](http://www.linkedin.com/company/the-orchard)
> > > > 
> > > > _Privileged And Confidential Communication._ This electronic  
> > > > transmission, and any documents attached hereto, (a) are protected by the  
> > > > Electronic Communications Privacy Act (18 USC §§ 2510-2521), (b) may  
> > > > contain confidential and/or legally privileged information, and (c) are for  
> > > > the sole use of the intended recipient named above. If you have received  
> > > > this electronic message in error, please notify the sender and delete the  
> > > > electronic message. Any disclosure, copying, distribution, or use of the  
> > > > contents of the information received in error is strictly prohibited.
> > > 
> > > --  
> > > Ing. Marco Betti  
> > > RHCE RHEL4 id 804006512121056
> > 
> > --  
> > Ing. Marco Betti  
> > RHCE RHEL4 id 804006512121056
> 
> --  
> _Nikhil Shah_ • _System Administrator_  
> [nshah@theorchard.com](mailto:nshah@theorchard.com) • _p._ (+1) 212 308-5648
> 
> THE ORCHARD _Distribution Done Right_  
> 23 E 4th St Fl 3, New York, NY 10003  
> [www.theorchard.com](http://www.theorchard.com)
> 
> _Follow us:_ The Daily Rind [http://www.dailyrindblog.com/](http://www.dailyrindblog.com/) • Facebook  
> [http://www.facebook.com/theorchard](http://www.facebook.com/theorchard) • Twitter  
> [http://www.twitter.com/orchtweets](http://www.twitter.com/orchtweets) • YouTube  
> [http://www.youtube.com/user/theorchard](http://www.youtube.com/user/theorchard) • LinkedIn  
> [http://www.linkedin.com/company/the-orchard](http://www.linkedin.com/company/the-orchard)
> 
> _Privileged And Confidential Communication._ This electronic  
> transmission, and any documents attached hereto, (a) are protected by the  
> Electronic Communications Privacy Act (18 USC §§ 2510-2521), (b) may  
> contain confidential and/or legally privileged information, and (c) are for  
> the sole use of the intended recipient named above. If you have received  
> this electronic message in error, please notify the sender and delete the  
> electronic message. Any disclosure, copying, distribution, or use of the  
> contents of the information received in error is strictly prohibited.

--  
_Nikhil Shah_ • _System Administrator_  
[nshah@theorchard.com](mailto:nshah@theorchard.com) • _p._ (+1) 212 308-5648

THE ORCHARD _Distribution Done Right_  
23 E 4th St Fl 3, New York, NY 10003

> **[The Orchard](https://www.theorchard.com/)**
>
> What started as a revolutionary music distribution company, continues to evolve but never loses sight of its main purpose: to empower creators to grow and adapt in the dynamic, global industry.

_Follow us:_ The Daily Rind [http://www.dailyrindblog.com/](http://www.dailyrindblog.com/) • Facebook  
[http://www.facebook.com/theorchard](http://www.facebook.com/theorchard) • Twitter  
[http://www.twitter.com/orchtweets](http://www.twitter.com/orchtweets) • YouTube  
[http://www.youtube.com/user/theorchard](http://www.youtube.com/user/theorchard) • LinkedIn  
[http://www.linkedin.com/company/the-orchard](http://www.linkedin.com/company/the-orchard)

_Privileged And Confidential Communication._ This electronic transmission,  
and any documents attached hereto, (a) are protected by the Electronic  
Communications Privacy Act (18 USC §§ 2510-2521), (b) may contain  
confidential and/or legally privileged information, and (c) are for the  
sole use of the intended recipient named above. If you have received this  
electronic message in error, please notify the sender and delete the  
electronic message. Any disclosure, copying, distribution, or use of the  
contents of the information received in error is strictly prohibited.
