New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ansible_make_role

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ansible_make_role

  • 0.8.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

ansible-make-role

Pre-compiler that turns a single-file role definition into Ansible role files. The single-file role.yml file combines the Ansible main.yml files from the defaults, vars, tasks, and meta subdirectories with a YAML top-level section for each file (defaults:, vars:, tasks: etc.)

Usage

    ansible-make-role -c|--clean -f|--force -g|--git -r|--roles=DIR -v|--verbose --version DIR...

ansible-make-role expects a role.yml file in each of the given directories and generates an Ansible role in it. Existing main.yml files will be overwritten or removed but other files won't be touched. ansible-make-role search subdirectories of ./roles if no dirctories was given on the command line

Description

The make.yml contains a section for each generated file so that eg. the tasks section becomes the tasks/main.yml file. The supported sections are defaults, vars, tasks, and handlers. Anything outside of those sections (notably dependencies) goes to the meta/main.yml file

Example:

---
dependencies: # Goes to meta/main.yml
  - role: rails-server

defaults: # Goes to defaults/main.yml
  appl_name: "myapp"
  appl_domain: "mydomain.com"

vars: # Goes to vars/main.yml
  appl_host: "{{ appl_name}}.{{ appl_domain }}"

tasks: # Goes to tasks/main.yml
  - name: "Ensure Apache"
    yum: name=httpd state=present
    notify: restart_httpd

  - name: "Ensure Apache is enabled"
    service: name=httpd enabled=yes

handlers: # Goes to handlers/main.yml"
  - name: restart_httpd
    servide name=httpd state=restarted

  ...

Options

-c, --clean Clean the project by removing autogenerated files

-f, --force Re-generate all files even if not needed. Useful if you forgot a --git option

-g, --git Also handle per-role .gitignore files. Note that existing .gitignore files are overwritten

-r, --roles=DIR Use DIR instead of default ./roles

-v, --verbose Report progress

--version Print version

Installation

Install it for the current ruby using:

$ gem install ansible_make_role

Please note that the gem name uses underscores but the command uses dashes ('ansible-make-role')

FAQs

Package last updated on 09 Aug 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc