In this recipe, you will learn how to run simple shell commands on minions at the same time as fulfilling various conditions, making sure that the requirements are met, and creating dependencies between definitions based on the output of commands.
salt-minion. Create a new state in the staging environment called ruby by creating a directory called
rubyin the base directory of the staging environment. Create the
/opt/salt-cookbook/staging/ruby/init.slsfile and edit it to have the following contents:
install_rvm_key: cmd.run: - name: "gpg2 --keyserver hkp://keys.gnupg.net --recv- keys D39DC0E3" - shell: /bin/bash - unless: "stat /root/.gnupg/trustdb.gpg ...