Coder Social home page Coder Social logo

cue-ansible's Introduction

cue-ansible

Write Ansible Playbooks in CUE

Why

Users write YAML files for Ansible. The experience could be enhanced using CUE with package importing, schema validation and more.

This repo provides you ready to use CUE packages for schema validation and guidance on how to integrate CUE with Ansible.

I created this project to get my hands dirty with CUE by putting it into a real usecase. You can use this repo as a reference to rewrite your Ansible Playbooks in CUE or learn some basic usage pattern of CUE.

Installation

You should install Ansible and CUE before using this repo. Some features are not included in the latest release of CUE. So please install CUE with go get -u cuelang.org/go/cmd/cue.

Write Playbook

Create a new folder called playbook and write your playbook in CUE. You could use example as a reference. It's almost the same like writing the playbook in YAML but you could use CUE to organize your code in packages and use module schemas to validate the task options.

Run Playbook

cue cmd play ./playbook will eval your playbook and write the result to playbook.yml. Then ansible-playbook will be executed to run the playbook as well.

You can put your legacy YAML based tasks in roles folder and use include_role module to load them in your playbook. In this way, you can migrate from YAML to CUE gradually.

Reference

cue-ansible's People

Contributors

adieu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

cue-ansible's Issues

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.