You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Lyz 637e5d7489
Merge branch 'improve/dont_use_loops'
7 months ago
defaults WIP: First iteration 1 year ago
meta Fix molecule lint errors 7 months ago
molecule Fix: make no_config test case work 1 year ago
tasks Fix molecule lint errors 7 months ago
vars [feat] initial commit 2 years ago
.gitignore [feat] initial commit 2 years ago
.yamllint [wip] first molecule tests 2 years ago
COPYING license and gitignore 2 years ago Upgrade version 1 year ago WIP: First iteration 1 year ago


Base rol to install programs



Role Variables

  • remove_git: Boolean to remove the .git directory (Default: False)
  • local_fetch: Boolean to fetch the configurations in the machine running ansible instead of in the target server (Default: False)
  • install : Dictionary with the information of the program to install

    • packages : List of packages to install with the package manager
    • pip_packages : List of pip packages to install
    • pip3_packages : List of pip3 packages to install
  • config: Dictionary with the information of the configuration

    • directory: Base directory to perform the clone of the configuration directory, for example: ~/.rcfiles.
    • git_repo: Url to the git group of repositories of your dotfiles, for example:
    • packages: List of packages to configure

Imagine that we’ve set

  directory: ~/.rcfiles
    - package_1
    - package_2

The configuration part will clone and into ~/.rcfiles/package_1 and ~/.rcfiles/package_2.

It assumes that in each of those repositories you have the same structure that you’d have on your home directory, so for example

$ tree -a ~/.rcfiles/package_1
├── .local
│   └── share
│       └── package_1_dir
└── .package1_rc

Example playbook

- hosts: all
    - generic_program_install


To test the role you need molecule.

molecule test --all

There are two test cases:

  • default: Tests normal usage with full features
  • no_config: Tests the case where no configuration is done


  • Refactor to avoid duplicated code, keeping in mind the ~/.config and /.local/share cases



Author Information

Lyz (