Skip to content

[Old repo - new one lives in redhat-cop!] A command-line tool for creating and working with OpenShift-Applier inventories.

License

Notifications You must be signed in to change notification settings

jacobsee/applier-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⛔ DEPRECATED REPO - NEW HOME ⛔

This original repository is no longer being maintained. All work has moved to the Red Hat CoP. Issues, pull requests, etc. submitted to this repo will not receive attention.

The following is for historical purposes only!

Applier-CLI

Applier-CLI is a tool for initializing and working with OpenShift-Applier inventories.

asciicast

Installation

OS X & Linux:

go get github.com/jacobsee/applier-cli

Commands

All commands here are subcommands of the main applier-cli binary.


init

Scaffolds an empty OpenShift-Applier project with the following structure:

[current directory]
├── apply.yml
├── files
├── inventory
│   ├── group_vars
│   │   └── all.yml
│   ├── hosts
│   └── host_vars
│       └── localhost.yml
├── params
├── roles
│   └── [large OpenShift-Applier role with many files]
├── requirements.yml
└── templates

Usage

This command does not take any input

Example

↪ applier-cli init
Initialized empty openshift-applier inventory
Successfully installed ansible-galaxy requirements

Notes

ℹ️ Applier-CLI uses the GitHub API to determine the latest release of OpenShift-Applier, and writes that version to the requirements.yml file.

ℹ️ Applier-CLI attempts to invoke ansible-galaxy to download the OpenShift-Applier role into the roles directory. If ansible-galaxy is unavailable, the roles directory will not be available.


add

Adds resources to the current OpenShift-Applier inventory. This command can source resources from files on the local machine, or from an existing OpenShift cluster that the user is authenticated to via the oc CLI. Resources which are of a kind other than Template can optionally be templatized. Template resources are added to the templates directory, and a corresponding parameters file is initialized in the params directory. Resources which are not templates are simply added to the files directory.

Usage

This command requires either the --from-cluster (-c) or the --from-file (-f) flags, indicating where to find the resource to be added to the inventory.

This command can accept the --make-template (-t) flag, which will wrap any non-template resource in a template before adding it to the inventory.

Optionally, the --edit (-e) flag can be passed, which opens the newly added resource in your default editor immediately after adding it to the inventory.

Example

↪ applier-cli add --from-cluster deployment/test-deployment --make-template --edit
<editor is invoked at this point>
Template added to the current inventory.
↪ applier-cli add --from-file ~/project/some_resource.yml
File added to the current inventory.

Notes

ℹ️ If using the --edit flag, the path to your default editor should either be set as the environment variable EDITOR, or set as the editor key in a $HOME/.applier-cli.yaml file. If neither of these are set, the editor default to vi.

ℹ️ The --edit flag is particularly useful when used in combination with the --make-template flag, as the customization of parameters is likely desired when --make-template is used.


get-latest-version

Displays the latest version of the OpenShift-Applier, as fetched by the GitHub Release API.

Usage

This command does not take any input

Example

↪ applier-cli get-latest-version
v2.0.8

Notes

ℹ️ This command does not touch the fileysstem and does not require you to be in an OpenShift-Applier inventory to operate.


run

Runs the current inventory against the cluster that the local oc client is logged in to.

Usage

With no flags set, run executes ansible-playbook on your local machine. There is also a --docker flag, which uses the OpenShift-Applier Docker container to run the playbook.

Example

↪ applier-cli run
<ansible-playbook output>
↪ applier-cli run --docker
<docker output... which should also look like an ansible playbook>

Notes

ℹ️ When the --docker flag is used, this command attempts to determine the current state of SELinux on the local machine. If SELinux is enforcing, this command adds:z to the Docker volume mount to ensure that filesystem permissions are correct.


Release History

  • 0.0.1
    • Work in progress

Meta

Jacob See – @jacobseejasee@redhat.com

Distributed under the Apache License, v2.0. See LICENSE for more information.

Contributing

  1. Fork it (https://github.com/jacobsee/applier-cli/fork)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

About

[Old repo - new one lives in redhat-cop!] A command-line tool for creating and working with OpenShift-Applier inventories.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages