Skip to content

using private pem file to execute ansible commands

Chakradhar Rao Jonagam edited this page Oct 20, 2016 · 2 revisions
ansible masters -m shell -a "pwd" --private-key=/home/ec2-user/openshift-aws-installer-image/ck_workshop.pem -u ec2-user
[masters]
35.000.239.131
35.000.10.44
35.000.252.32

[nodes]
35.000.162.179
35.000.31.38

Execute a sudo command

ansible masters -m shell -a 'subscription-manager register --username=cjonagam --password=Earth@1010' --private-key=/home/ec2-user/openshift-aws-installer-image/ck_workshop.pem  -su --su-user=ec2-user -u ec2-user
Clone this wiki locally