Giter VIP home page Giter VIP logo

staticdev / ansible-role-firefox Goto Github PK

View Code? Open in Web Editor NEW

This project forked from basvandenbrink/ansible-firefox

5.0 5.0 2.0 299 KB

Ansible role to install Firefox with multiple profiles (each with its own settings and extensions)

Home Page: https://galaxy.ansible.com/staticdev/firefox

License: MIT License

Python 100.00%
ansible browser firefox graphical role system web workstation

ansible-role-firefox's Introduction

Welcome, I'm Thiago AKA staticdev ๐Ÿ‘‹

  • ๐Ÿ”ญ Iโ€™m currently working with telco
  • ๐Ÿ‘ฏ Iโ€™m collaborating on assorted open-source projects
  • ๐ŸŒฑ Iโ€™m a researcher in chatbots and artificial intelligence
  • ๐Ÿ’ฌ Ask me about anything here

python golang bash jenkins docker kubernetes ansible


I maintain these open-source projects:


I have contributed to or previously maintained these open-source projects, among others:


staticdev's Github Stats

ansible-role-firefox's People

Contributors

basvandenbrink avatar dependabot[bot] avatar staticdev avatar tlvu avatar unrblt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ansible-role-firefox's Issues

Make a way to select the profile ?

Hi

Using this in my ansible install script for my computers, it would be neat if there would be an option to automatically select the profile created when Firefox was never ran. It seems like if you run this script with no ~/.mozilla (Clean install) then you start firefox, it generates another profile instead of using the one created.

It would be useful to either:

  • Run with the created profile (Not sure but it seems that it's the installs.ini that takes care of this
  • Let me change the StartWithLastProfile to 0 so that I don't have to run Firefox from the command line first to select my profile
  • Return the profile path so that I can store it and do this myself

Anyway, thanks for the role its quite useful !

Permission Paradoxon

Running a playbook as a normal user results in

TASK [staticdev.firefox : Install Firefox] **************************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "This command has to be run under the root user.", "results": []}

Running a playbook as root or with sudo results in

TASK [staticdev.firefox : Create profiles] **************************************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: Exception: b"Running Firefox as root in a regular user's session is not supported.  ($XAUTHORITY is /run/user/1000/xauth_UfVbev which is owned by red.)\n"
fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n  File \"/root/.ansible/tmp/ansible-tmp-1682205835.564357-57101-152754041300560/AnsiballZ_firefox_profile.py\", line 107, in <module>\n    _ansiballz_main()\n  File \"/root/.ansible/tmp/ansible-tmp-1682205835.564357-57101-152754041300560/AnsiballZ_firefox_profile.py\", line 99, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/root/.ansible/tmp/ansible-tmp-1682205835.564357-57101-152754041300560/AnsiballZ_firefox_profile.py\", line 47, in invoke_module\n    runpy.run_module(mod_name='ansible.modules.firefox_profile', init_globals=dict(_module_fqn='ansible.modules.firefox_profile', _modlib_path=modlib_path),\n  File \"<frozen runpy>\", line 226, in run_module\n  File \"<frozen runpy>\", line 98, in _run_module_code\n  File \"<frozen runpy>\", line 88, in _run_code\n  File \"/tmp/ansible_firefox_profile_payload_ux2jqxhz/ansible_firefox_profile_payload.zip/ansible/modules/firefox_profile.py\", line 119, in <module>\n  File \"/tmp/ansible_firefox_profile_payload_ux2jqxhz/ansible_firefox_profile_payload.zip/ansible/modules/firefox_profile.py\", line 109, in main\n  File \"/tmp/ansible_firefox_profile_payload_ux2jqxhz/ansible_firefox_profile_payload.zip/ansible/modules/firefox_profile.py\", line 88, in create\nException: b\"Running Firefox as root in a regular user's session is not supported.  ($XAUTHORITY is /run/user/1000/xauth_UfVbev which is owned by red.)\\n\"\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}

`Exception: b'/bin/sh: 1: firefox: not found\n'` encountered while attempting to install/configure ansible role

I'm encountering the following exception while attempting to install/configure the ansible role

Traceback (most recent call last):
  File "/root/.ansible/tmp/ansible-tmp-1674603780.0506513-450-204423107100632/AnsiballZ_firefox_profile.py", line 107, in <module>
    _ansiballz_main()
  File "/root/.ansible/tmp/ansible-tmp-1674603780.0506513-450-204423107100632/AnsiballZ_firefox_profile.py", line 99, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File "/root/.ansible/tmp/ansible-tmp-1674603780.0506513-450-204423107100632/AnsiballZ_firefox_profile.py", line 47, in invoke_module
    runpy.run_module(mod_name='ansible.modules.firefox_profile', init_globals=dict(_module_fqn='ansible.modules.firefox_profile', _modlib_path=modlib_path),
  File "/usr/lib/python3.8/runpy.py", line 207, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File "/usr/lib/python3.8/runpy.py", line 97, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/tmp/ansible_firefox_profile_payload_b4mdivjc/ansible_firefox_profile_payload.zip/ansible/modules/firefox_profile.py", line 119, in <module>
  File "/tmp/ansible_firefox_profile_payload_b4mdivjc/ansible_firefox_profile_payload.zip/ansible/modules/firefox_profile.py", line 109, in main
  File "/tmp/ansible_firefox_profile_payload_b4mdivjc/ansible_firefox_profile_payload.zip/ansible/modules/firefox_profile.py", line 88, in create
Exception: b'/bin/sh: 1: firefox: not found\n'

See https://github.com/tetrabiodistributed/tetra-workspace-image/actions/runs/4001442035/jobs/6867670993#step:5:948 for exception
Playbook details here https://github.com/tetrabiodistributed/tetra-workspace-image/blob/70c6825db805643f12551c3f980df2973d6bd1e6/playbook.yaml#L391

Feature Request: Add variable to disable install and only configure profiles

Thanks for maintaining the great role!

Would you be open to adding a variable to parameterize whether this role manages the install? I find configure_profile.yml super useful, and would love it if the role had a way to easily only run that. I would think putting in a variable like firefox_install with a default of true shouldn't impact the functionality for existing users.

- name: Configure profiles

Change from prefs.js to user.js

When I run a playbook with Firefox closed, it changes prefs.js.
But as soon as I relaunch Firefox, all changes are gone.
Using user.js would resolve this problem!

We should listen to Mozilla's message in prefs.js!

// Mozilla User Preferences

// DO NOT EDIT THIS FILE.
//
// If you make changes to this file while the application is running,
// the changes will be overwritten when the application exits.
//
// To change a preference value, you can either:
// - modify it via the UI (e.g. via about:config in the browser); or
// - set it within a user.js file in your profile.

There are many popular user.js'

and I would like to use staticdev.firefox to "install" and maybe even update one of them and then apply my custom changes. In this way I'm guaranteed to have the latest version of my favorite user.js with my tweaks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.