- Syntax: ansible <pattern> -u <username> -i <inventory_file> -m <module_name> -a <arguments>
- <pattern> : represents the group name of the list of hosts defined
- <username>: user name to override any values defined in config file
- <inventory_file>: path to the static ansible inventory file
- <module_name>: ansible modules to use
- <arguments>: arguments module to specify
- ansible prod-webserver -u autouser -i inventory/dc_chicago -m command -a "date" /*Execute an ansible ad-hoc command as an user*/
- ansible-galaxy init <ansible_role_name> /*Will create a default ansible project directory structure*/
- vim -c "<command>" <file to execute the script on>
eg:- vim -c "%s/\s\+$//e" -c "wq" file1.txt /*Deletes space at the end of each line without prompting error*/
Friday, January 20, 2017
Handy Linux Commands
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment