Giter Club home page Giter Club logo

ansible-role-git's Introduction

Role Name

This Ansible Role will ensure the GIT tool is installed and configured according to the user preferences. Settings can be customized through variables. Take a look in the existing standards defined in "defaults/main.yml" and overridden them in a playbook.

This role will:

  • Ensure GIT is installed;
  • Ensure the proper settings in ~/.gitconfig;
  • Ensure the PS1 variable is defined to show the current branch when working in a GIT repository;

To install this role:
$ ansible-galaxy role install marcusburghardt.git

Requirements

  • python3

Role Variables

You can customize your environment in a very simple and centralized way editing some variables in:

  • defaults/main.yml

In some rare cases, you may change some configuration to reflect your local environment in:

  • vars/*.yml

Observe that the above variables could be set in your playbook too, which, IMO is much more elegant. ;)
Take a look in the Example Playbook section.

Dependencies

None.

Example Playbook

This playbook will prepare everything with the right variables.
For this example, lets call this playbook file as "ansible_git.yml":


  • hosts: linux vars:
    • git_tasks:
      • { enabled: true, name: 'configure_git' }
      • { enabled: true, name: 'configure_ps' } roles:
    • marcusburghardt.git

Considering the inventory file is in the same folder and is called "hosts_git", you can now run this command:
$ ansible-playbook -K -i hosts_git ansible_git.yml

License

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

Author Information

Marcus Burghardt

ansible-role-git's People

Contributors

marcusburghardt avatar

Watchers

 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.