GithubHelp home page GithubHelp logo

iamgini / ansible-collection-system-utils Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 1.0 44 KB

Ansible Collection to manage systems and services

Home Page: https://galaxy.ansible.com/iamgini/system_utils/

License: Apache License 2.0

Jinja 100.00%
ansible automation devops

ansible-collection-system-utils's Introduction

Ansible Collection - iamgini.system_utils

Collection Name: iamgini.system_utils

Installation

Install this collection locally:

ansible-galaxy collection install iamgini.system_utils

Testing Modules

$ ansible-navigator run playbooks/create-user.yaml \
    -e "nodes=rhel8" \
    -e "new_user_public_key='your-ssh-public-key'" \
    -u vagrant

Sample Playbooks

Sample playbooks are available in playbooks directory.

---
- name: Create new user
  hosts: "{{ nodes | default('no-such-hosts') }}"
  gather_facts: false
  become: true
  vars:
    new_user_name: devops
    new_user_password: devops
    # new_user_public_key: 'public key string to add'
  tasks:
    - name: Add user
      ansible.builtin.include_role:
        name: add_user

Sharing Collection to Ansible Galaxy

Contribute back to the community !

You can use either the GUI method (browsing the Zip file and upload to Ansible Galaxy) or the CLI method with API token.

Publishing Ansible Collection using Ansible Playbook

I have an Ansible playbook which will build and publish the Ansible Collection with proper version tag.

$ ansible-playbook utilities/update-collection.yaml -e "tag=1.0.10"

# or use the Private Automation Hub
$  ansible-playbook utilities/update-collection.yaml -e "tag=0.0.1 server=https://pah.lab.local/api/galaxy/content/published/"

Publishing Ansible Collection Manually

Configure ANSIBLE_GALAXY_TOKEN

$ export ANSIBLE_GALAXY_TOKEN='YOUR_ANSIBLE_GALAXY_API_TOKEN'

Building the collection archive

ansible-galaxy collection build command will create the collection archive with version information which you can publish to Ansible Galaxy.

$ ansible-galaxy collection build
# --force to overwrite if any existing archive with same version

% ls -la *.tar.gz
-rw-r--r--  1 gini  staff  7023  8 Sep 11:12 iamgini-collection_demo_roles_modules-1.0.10.tar.gz

Publish the Collection to Ansible Galaxy

Make sure you have created the Ansible Galaxy API Token and exported as environment variable ANSIBLE_GALAXY_TOKEN before you call the publish command.

$ ansible-galaxy collection publish \
  ./iamgini-collection_demo_roles_modules-{{ tag }}.tar.gz \
  --api-key $ANSIBLE_GALAXY_TOKEN \
  --ignore-certs

ansible-collection-system-utils's People

Contributors

iamgini avatar

Watchers

 avatar

Forkers

krishnagarre

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.