0

I'm writing some roles for setting up a virtual machine using ansible.

I'm trying to set the gnome-terminal color theme to Solarized https://github.com/Anthony25/gnome-terminal-colors-solarized

I can run the script from the terminal and the color changes immediately

$ ~/solarized/gnome-terminal-colors-solarized/install.sh -s dark -p Default

But when I run it from ansible:

  - name: Set Solarized color to Default profile
    script: /home/someuser/solarized/gnome-terminal-colors-solarized/install.sh -s dark -p Default

The result look ok

TASK: [solarized | Set Solarized color to Default profile] *********************** 
changed: [localhost]

But nothing changed! I check the config file at ~/.gconf/apps/gnome-terminal/profiles/Default/ and it did not change as well

I tried shell, command but still the same result.

I tried run

install.sh -s lkefjefj -p lefjelkfj 

and it throws errors, so it actually reads the arguments

The script is run with sudo option.

So I do not understand why it is not working?

Pham
  • 1,065
  • 1
  • 7
  • 9

1 Answers1

1

I found the problem. The script is run in ansible as root user when I declare "sudo: yes" in the main playbook. when I supplied "sudo_user: my_user" it run correctly

Pham
  • 1,065
  • 1
  • 7
  • 9