In modern dynamic environments, usage of code repositories is considered vital for efficient code management, collaboration, and practices such as Continuous Integration. Fortunately, Salt makes it easy enough to manage code repositories using its modules. In this recipe, you will learn how to manage code repositories using Git.
We will use the same minion and state directory as the previous recipe:
Create and edit the
/opt/salt-cookbook/staging/apache/git_repo.sls
file to have the following entries:git: pkg: - installed user: - present - home: /home/git /opt/apache-repo: file.directory: - user: git - group: git - dir_mode: 0755 - require: - user: git /home/git/.ssh: file.directory: - user: git - group: git - dir_mode: 775 - require: - user: git git-key: file.managed: - name: /home/git/.ssh/id_rsa - source: salt://apache/keys/id_rsa - user: git - group: git...