https://github.com/ansible/ansible_tower_client_ruby
Ruby gem for the Ansible Tower REST API
https://github.com/ansible/ansible_tower_client_ruby
Last synced: 3 months ago
JSON representation
Ruby gem for the Ansible Tower REST API
- Host: GitHub
- URL: https://github.com/ansible/ansible_tower_client_ruby
- Owner: ansible
- License: mit
- Archived: true
- Created: 2016-01-08T21:58:48.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2021-06-03T18:19:50.000Z (over 4 years ago)
- Last Synced: 2025-01-01T20:45:11.853Z (12 months ago)
- Language: Ruby
- Homepage: https://ansible.com/tower
- Size: 329 KB
- Stars: 18
- Watchers: 6
- Forks: 41
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# AnsibleTowerClient
[](http://badge.fury.io/rb/ansible_tower_client)
[](https://travis-ci.org/ansible/ansible_tower_client_ruby)
[](https://codeclimate.com/github/ansible/ansible_tower_client_ruby)
[](https://gemnasium.com/ansible/ansible_tower_client_ruby)
[](https://coveralls.io/r/ansible/ansible_tower_client_ruby)
[](https://hakiri.io/github/ansible/ansible_tower_client_ruby/master)
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'ansible_tower_client'
```
And then execute:
$ bundle
Or install it yourself as:
$ gem install ansible_tower_client
## Usage
```ruby
require 'ansible_tower_client'
# Optionally set a global logger
AnsibleTowerClient.logger = Logger.new(STDOUT)
# Create a connection
conn = AnsibleTowerClient::Connection.new(
:base_url => "https://awx.example.com/",
:username => "admin",
:password => "pa$$w0rd!",
:verify_ssl => OpenSSL::SSL::VERIFY_PEER # Optional: an OpenSSL::SSL::VERIFY_* constant
)
# Query the config
conn.api.config
# => {"eula"=>"text"
# "version"=>"3.2.2",
# "project_base_dir"=>"/var/lib/awx/projects",
# "ansible_version"=>"2.4.1.0",
# ...}
# Query a collection
conn.api.job_templates.all
# => [
# ]
```
## Development
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake rspec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/Ansible/ansible_tower_client_ruby.
## License
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).