GithubHelp home page GithubHelp logo

ansible-generic-program-install's Introduction

generic_program_install

Base rol to install programs

Requirements

None

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: https://git.myrepo.com/rcfiles.
    • packages: List of packages to configure

Imagine that we've set

config:
  directory: ~/.rcfiles
  git_repo: https://git.myrepo.com/rcfiles
  packages:
    - package_1
    - package_2

The configuration part will clone https://git.myrepo.com/rcfiles/package_1 and https://git.myrepo.com/rcfiles/package_2 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
  roles:
    - generic_program_install

Testing

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

Todo

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

License

GPLv2

Author Information

Lyz ([email protected])

ansible-generic-program-install's People

Contributors

lyz-code avatar

Watchers

 avatar  avatar  avatar

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.