- Create a state to be utilised in your working environment
- Clone git repo!
SaltStack installed on the machine.
VM1: Running Mint 17.2, Salt master || specs
I wanted to create a highstate that first installs Git, clones my repository and installs some Python libraries.
I created this ‘not-so-well-executed’ state to clone my repository for my current project.
State located in
Running commands in Salt state is not recommended, but this does do the job. My repository is open, therefore there’s no need for passwords in this execution.
I tested this state, it ran fine the first time, but ran into problems using cmd.run.
Instead of using cmd.run, I used cmd.wait, which will only modify directories/scripts if changes are made.
Running the state a few times, and all is good.
I also added a few line to the git-state to automate the login, so that there’s no need to always enter password on
Before proceeding, both modules were tested to be working correctly.
And then I ran the highstate.
sudo salt slaveVM01 state.highstate
I created this highstate in order to more easily manage my laptop and other computers I use for development purposes. It will be a lot more easier to run a few states than always manually install python libraries and clone a git repo.
- Copying, modifying and redistributing this and all the other documents in this blog is allowed according to the GNU General Public License (versio 2 or newer).http://www.gnu.org/licenses/gpl.html
- Based on the Linux course by Tero Karvinen 2015: terokarvinen.com