forked from ISTI-ansible-roles/ansible-roles
ansible.sh: Add env variables to talk with foreman.
cm/site.yml: Install foreman. library/roles: Basic foreman installation role. library/roles/openjdk: Ansible 2 fixes.
This commit is contained in:
parent
f6414fdb92
commit
1095dd936c
|
@ -0,0 +1,14 @@
|
||||||
|
---
|
||||||
|
# foreman PKG state: latest, installed, absent
|
||||||
|
foreman_pkg_state: latest
|
||||||
|
foreman_repos:
|
||||||
|
- 'deb http://deb.theforeman.org/ trusty 1.10'
|
||||||
|
- 'deb http://deb.theforeman.org/ plugins 1.10'
|
||||||
|
|
||||||
|
foreman_repo_key: 'http://deb.theforeman.org/pubkey.gpg'
|
||||||
|
|
||||||
|
foreman_puppetlabs_repo_pkg: 'puppetlabs-release-{{ ansible_distribution_release }}.deb'
|
||||||
|
foreman_puppetlabs_repo_url: 'https://apt.puppetlabs.com/{{ foreman_puppetlabs_repo_pkg }}'
|
||||||
|
|
||||||
|
foreman_ansible_plugin:
|
||||||
|
- ruby-foreman-ansible
|
|
@ -0,0 +1,33 @@
|
||||||
|
---
|
||||||
|
- name: Download the puppetlabs repo package
|
||||||
|
get_url: url='{{ foreman_puppetlabs_repo_url }}' dest=/srv/{{ foreman_puppetlabs_repo_pkg }}
|
||||||
|
register: puppetlabs_repo
|
||||||
|
tags: foreman
|
||||||
|
|
||||||
|
- name: Install the puppetlabs repo package
|
||||||
|
apt: deb=/srv/{{ foreman_puppetlabs_repo_pkg }} update_cache=yes
|
||||||
|
when: puppetlabs_repo | changed
|
||||||
|
tags: foreman
|
||||||
|
|
||||||
|
- name: Add the foreman repo keys
|
||||||
|
apt_key: url='{{ foreman_repo_key }}' state=present
|
||||||
|
|
||||||
|
- name: Add the foreman repos
|
||||||
|
apt_repository: repo='{{ item }}' update_cache=yes
|
||||||
|
with_items: '{{ foreman_repos }}'
|
||||||
|
tags: foreman
|
||||||
|
|
||||||
|
- name: Install the ansible foreman plugin
|
||||||
|
apt: pkg={{ item }} state={{ foreman_pkg_state }}
|
||||||
|
with_items: '{{ foreman_ansible_plugin }}'
|
||||||
|
tags: foreman
|
||||||
|
|
||||||
|
- name: Install the foreman installer
|
||||||
|
apt: pkg=foreman-installer state={{ foreman_pkg_state }}
|
||||||
|
register: foreman_installer_pkg
|
||||||
|
tags: foreman
|
||||||
|
|
||||||
|
- name: Run the foremann installer
|
||||||
|
shell: foreman-installer
|
||||||
|
when: foreman_installer_pkg | changed
|
||||||
|
tags: foreman
|
|
@ -0,0 +1,3 @@
|
||||||
|
---
|
||||||
|
- include: foreman-packages.yml
|
||||||
|
|
|
@ -2,21 +2,17 @@
|
||||||
- name: Update the apt cache, if needed
|
- name: Update the apt cache, if needed
|
||||||
apt: update_cache=yes
|
apt: update_cache=yes
|
||||||
when: openjdk_pkg_state == 'latest'
|
when: openjdk_pkg_state == 'latest'
|
||||||
tags:
|
tags: jdk
|
||||||
- jdk
|
|
||||||
|
|
||||||
- name: install OpenJDK JRE
|
- name: install OpenJDK JRE
|
||||||
apt: pkg=openjdk-{{ item.0 }}-{{ item[1] }} state={{ openjdk_pkg_state }}
|
apt: pkg=openjdk-{{ item.0 }}-{{ item[1] }} state={{ openjdk_pkg_state }}
|
||||||
with_nested:
|
with_nested:
|
||||||
- openjdk_version
|
- '{{ openjdk_version }}'
|
||||||
- [ 'jre', 'jre-headless', 'jdk' ]
|
- [ 'jre', 'jre-headless', 'jdk' ]
|
||||||
notify:
|
notify: Set the default OpenJDK
|
||||||
Set the default OpenJDK
|
tags: jdk
|
||||||
tags:
|
|
||||||
- jdk
|
|
||||||
|
|
||||||
- name: Set fact jdk_installed
|
- name: Set fact jdk_installed
|
||||||
set_fact: jdk_installed=true
|
set_fact: jdk_installed=true
|
||||||
tags:
|
tags: jdk
|
||||||
- jdk
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue