-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to use it? #10
Comments
Hi, just install the Python library on your Ansible control server and use the examples from README.MD. Small example how i use it to deploy CoreOS Cluster: ---
- hosts: local
connection: local
gather_facts: false
tasks:
- name: Ensure CoreOS nodes
foreman_host:
name: '{{ item.name }}'
build: true
compute_profile: '{{ coreos_host_compute_profile }}'
compute_resource: '{{ coreos_host_compute_resource }}'
environment: production
hostgroup: '{{ coreos_host_hostgroup }}'
location: '{{ foreman_default_location }}'
managed: true
organization: '{{ foreman_default_organization }}'
parameters: '{{ coreos_host_parameters }}'
state: '{{ coreos_host_state }}'
foreman_host: '{{ foreman_host }}'
foreman_port: '{{ foreman_port }}'
foreman_user: '{{ foreman_user }}'
foreman_pass: '{{ foreman_pass }}' Beforehand you should use foreman_compute_profile, foreman_compute_resource, ... to configure Foreman resources. Variables like compute_resource, compute_profile are just strings. You can get them by curling your Foreman API. As i'm using Foreman to create my cloud-init i have to pass some parameters which Foreman needs to build it. Example: coreos_host_parameters:
- name: coreos_version
value: '{{ coreos_version }}'
- name: coreos_channel
value: '{{ coreos_channel }}'
- name: users
value: '{{ coreos_users | github_ssh_users_foreman }}'
- name: user_primary_group
value: '{{ coreos_user_primary_group }}'
- name: user_groups
value: '{{ coreos_user_groups | join(",") }}' When using my Python-Foreman module you can Backup your Foreman in an Ansible usable format using -a. Hope this helps P.S. It's not merged. Feel free to fork and used it. It's for free :-) |
Thanks for additional info! |
Great. Thanks. Please let me know your test results. I would really like to create a PR to the Ansible extra modules repo. |
IMHO unfortunately, your code will never make it because of http://ansible-project.narkive.com/xM2B8jCh/ansible-and-theforeman-integration |
Hello there!
It seems to be interesting code, is it merged? Are there any plans to merge? How one can use it right now if it's not merge yet.
thanks!
The text was updated successfully, but these errors were encountered: