Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Saltstack notes
- ## salt-master location
- > 10.55.9.173
- ```sh
- ssh calebfranklin@10.55.9.173
- ```
- ## Every day tasks
- ### Create a user
- ```sh
- salt '<minion_id>' user.add <username> <password>
- salt '<minion_id>' user.update <username> password_never_expires=True account_disabled=False unlock_account=True
- salt '<minion_id>' user.addgroup <username> "<group>" #typically "Administrators"
- ```
- ### Delete a user
- ```sh
- salt '<minion_id>' user.delete <username> remove=True force=True
- ```
- ### Reset a users password
- ```sh
- salt '<minion_id' user.setpassword <username> <newpassword>
- ```
- ### Create a group and add a user to it
- ```sh
- salt '<minion_id>' group.add <groupname>
- salt '<minion_id>' group.adduser <groupname> <username>
- ```
- ### View unaccepted minion keys
- ```sh
- salt-key -l un
- ```
- ### View the IP of a minion
- ```sh
- salt '<minion_id>' network.ip_addrs
- ```
- ## Helpful hints
- ### Run a single state function
- ```sh
- salt '<minion_id>' state.single pkg.installed name=vim
- ```
- ### Apply a specific state to a minion
- ```sh
- salt '<minion_id>' state.apply <state_name>
- ```
- ### Dry run / test
- ```sh
- salt '<minion_id>' state.apply <state_name> test=true
- ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement