ansible for centos cloud images

Newer CentOS including Amazon Linux appears to enable “Defaults requiretty” in sudoers.  Here’s an evil workaround to disable it:

# This is evil, use "-t -t" to force tty to disable requiretty
- local_action: command ssh -t -t ec2-user@{{inventory_hostname}} "sudo sed -i '/^Defaults    requiretty/d' /etc/sudoers"
  sudo: false

1 thought on “ansible for centos cloud images

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s