Giter VIP home page Giter VIP logo

ansible-role-yedit's Introduction

yedit repository

Ansible Role: Yedit

This repository contains an ansible module for modifying yaml files.

I didn’t see a good method of editing yaml files and config managing them through ansible. This is my attempt.

Install

You can install via Ansible Galaxy:

$ ansible-galaxy install kwoodson.yedit

If you do this, you should also add a requirements.yml so other users of your playbook know what dependencies to install:

---
- src: kwoodson.yedit

You can then reference it in a play by importing it before use:

  roles:
    - kwoodson.yedit
    - role-that-uses-yedit

Examples

Sometimes it is necessary to config manage .yml files.

- hosts: localhost
  gather_facts: no
  roles:
  - kwoodson.yedit
  tasks:
  - name: manage yaml files
    yedit:
      src: /tmp/test.yaml
      key: a.b.c
      value:
        d:
          e:
            f:
              this is a test

  - name: get a specific value
    yedit:
      src: /tmp/test.yaml
      state: list
      key: a.b.c.d.e.f
    register: yeditout
  - debug: var=yeditout

Development

As this is a role, just copy it into any roles directory recognized by Ansible. For details, see Ansible documentation:

Documentation

Full documentation is available inline here.

ansible-role-yedit's People

Contributors

luto avatar ashcrow avatar ctornatta avatar kwoodson avatar tdmalone avatar fbuchmeier avatar benjamb avatar fdammeke avatar brutus avatar marksteward avatar mmoucka avatar illes 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.