Need some Ansible help - Page 2
FedoraForum.org - Fedora Support Forums and Community
Page 2 of 2 FirstFirst 1 2
Results 16 to 23 of 23
  1. #16
    Join Date
    Jan 2013
    Location
    New York state in USA
    Posts
    241
    Linux (Fedora) Firefox 61.0

    Re: Need some Ansible help

    Progress:

    I got sidetracked for a bit with gconf then I read the dconf replaced gconf. Then I read the dconf serves as a backend for gsettings and that gsettings does a fair amount of checking to be sure a given gsettings command is correct in the key being called out and the value of the key. here are a couple typical set commands:

    Code:
    gsettings set org.gnome.desktop.interface cursor-theme 'Bluecurve'
    gsettings set org.gnome.desktop.interface toolkit-accessibility false
    I wanted to be sure I was getting things right so I decided to use gsettings as a way to verify the settings I want to make. I am glad I did. The feedback from gsettings though very sparse at least let me know I had an error so I could do the research etc. to fix it. So far I have between 150 and 200 lines of gsettings in a bash script that work. I still have some keys to find. Most of the schemas are in /usr/share/lib-2.0/schemas, but not all of them are there. Also I haven't really searched all of the schema in /usr/share/lib-2.0/schemas yet either. Some of the keys are lists of strings. I haven't figured out yet how to do them correctly yet.

    Thinking back on my situation: All of the systems here get the same applications removed and the same application installed and I already have bash scripts to take care of that. I do a clean install from DVD to each machine. No machine management is done over the network. I already have most of the key settings I need in a bash script. Given all of that redoing everything in Ansible doesn't make sense. So I think I will just use my scripts for now .

    The one big mystery I have to solve yet is that of the "serialized GVariant". the values of keys are serialized GVariants. Integers, binaries, and simple strings have been straight forward. How to format a list though, is still not clear. So far everything I have tried has not been acceptable to gsettings. For instance I want to set the key that holds the list of favorite applications. in the org.gnome.shell schema there is the key favorite-apps. I thought something like this should work, but it does not:

    Code:
    gsettings set org.gnome.shell favorite-apps ['libreoffice-writer.desktop', 'libreoffice-calc.desktop',  'grsync.desktop']
    I've tried variants, but so far no luck.

    Any ideas?
    Have a Great Day!

  2. #17
    Join Date
    Dec 2017
    Location
    USA
    Posts
    57
    Windows 7 Firefox 60.0

    Re: Need some Ansible help

    Is it possible how you set up the list here simply needs to be passed in as a single variable-- i.e., put double quotes around your whole array:
    Code:
    "['libreoffice-writer.desktop', 'libreoffice-calc.desktop',  'grsync.desktop']"
    And the quoting thing is a shell problem. It probably needs to pass to the gsettings application a single long string, which consists of the square braces and everything inside it.
    Although I would suspect it takes a comma separated list. But you maybe can check if you can find a way to dump the current set of values for that variable.

  3. #18
    Join Date
    Jan 2013
    Location
    New York state in USA
    Posts
    241
    Linux (Fedora) Firefox 61.0

    Re: Need some Ansible help

    Thank you very much that worked Great!!

    I just put the double quotes around the array and it worked. I really appreciate your help.
    Have a Great Day!

  4. #19
    Join Date
    Jan 2013
    Location
    New York state in USA
    Posts
    241
    Linux (Fedora) Firefox 61.0

    Re: Need some Ansible help

    Continuing progress. One of the parameters I wanted to set automatically was display resolution. The folks at Gnome provided these:

    You can not set resolution with gsettings... You will have to use D-Bus interface - org.gnome.Mutter.DisplayConfig
    I did some searching and and found some articles that led me to think that setting this is going to be complicated; So I'm going to wait on this for a while.

    or copy the ~/.config/monitors.xml file around
    My systems do not seem to have a monitors.xml file. From my additional reading it seems like a system only has a monitors.xml file if you have more that one monitor on the system.

    I also wanted to set some parameters for the gnome-terminal. It seemed quite straight forward until I got a message from gsettings that said the keys in org.gnome.Terminal.Legacy.Profile are relocatable and I had to provide the path for the setting. I tried a bunch of different things, but had no luck. Then the folks at AskFedora showed me the correct way to include the path with this example:

    Code:
    gsettings set org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:$(gsettings get org.gnome.Terminal.ProfilesList default)/ use-system-font false
    I noticed that the path being used was the default, but that seemed reasonable since I don't think I have changed it. This command runs with no messages from gsettings, but when I open the gnome terminal and it's preferences the parameter had not changed.

    I guessing the real path is not the default. Any ideas?
    Have a Great Day!

  5. #20
    Join Date
    Jan 2013
    Location
    New York state in USA
    Posts
    241
    Linux (Fedora) Firefox 61.0

    Re: Need some Ansible help

    On further searching, it turns out that the PCs here do have a monitors.xml file loacated exactly where I was told to look for it. I have no idea why I did not find it the first time I looked. I may have forgotten to turn on the show hidden files.

    So it turns out I can copy that file from a configured PC then have one of my setup scripts copy it to the PC I am setting up to replace the existing file. The trouble with this is that it would have to be copied into each user account's home directory. There are only two accounts on each PC, but the User account it not usually setup at this point in my process; so I have to rethink how I want to do that.
    Have a Great Day!

  6. #21
    Join Date
    Jan 2013
    Location
    New York state in USA
    Posts
    241
    Linux (Fedora) Firefox 61.0

    Re: Need some Ansible help

    In regard to setting terminal parameters I wrote about in post #19: I have filed an Issue in regard to gnome-terminal at the Gnome gitlab site. Here is the link if you would like to follow this.

    https://gitlab.gnome.org/GNOME/gnome-terminal/issues/24
    Have a Great Day!

  7. #22
    Join Date
    Jan 2013
    Location
    New York state in USA
    Posts
    241
    Linux (Fedora) Firefox 61.0

    Re: Need some Ansible help

    Wow! That was fast. I got a reply to the Gnome issue:

    gsettings get returns the profile ID enclosed within single quotes, which should be removed. If you navigate in dconf-editor to /org/gnome/terminal/legacy/profiles:, you'll find a :b1ccblahblah which you should have modified, and a :'b1ccblahblah' which you created and modified instead.
    I verified that with dconf-editor as suggested and sure enough there are two profiles. That is why I didn't get an error message from the gsettings command I used, but the terminal didn't change. Here is one of the commands I used:

    Code:
    gsettings set org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:$(gsettings get org.gnome.Terminal.ProfilesList default)/ use-system-font false
    Can someone help me redo this command so the single quotes that come back around the:
    Code:
    gsettings get org.gnome.Terminal.ProfilesList default
    part of this are removed?

    Thanks in advance for your help on this.
    Have a Great Day!

  8. #23
    Join Date
    Jan 2013
    Location
    New York state in USA
    Posts
    241
    Linux (Fedora) Firefox 61.0

    Re: Need some Ansible help

    Well, this thread is getting pretty deep; so I'm going to move on as they say.
    Have a Great Day!

Page 2 of 2 FirstFirst 1 2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •