Last active
August 29, 2015 13:56
-
-
Save skamithi/8995933 to your computer and use it in GitHub Desktop.
Ansible Tips
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Execute gnome action as a user | |
| - name: enable middle click | |
| shell: "sudo -u {{ core_username.stdout }} dbus-launch gsettings set org.gnome.settings-daemon.peripherals.mouse middle-button-enabled true" | |
| # Execute Gem Install using RVM | |
| - name: install knife-solo | |
| shell: > | |
| executable=/bin/bash source /etc/profile.d/rvm.sh; | |
| gem install --no-ri --no-rdoc knife-solo | |
| # Check if a file exists | |
| - name: check if RVM is installed | |
| stat: path=/etc/profile.d/rvm.sh | |
| register: rvm | |
| - name: run apt-get update again. will speed up rvm install | |
| apt: update_cache=yes | |
| when: rvm.stat.exists == False | |
| #Assign core user of laptop to 'core_username' var | |
| - name: get username of core user | |
| shell: 'grep "^sudo" /etc/group | cut -d: -f4 | cut -d, -f1' | |
| register: core_username |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment