Browse Source

compatibilite centos pour le rudder agent

master
LecygneNoir 6 years ago
parent
commit
ad373c050a
3 changed files with 56 additions and 25 deletions
  1. +27
    -0
      roles/rudder-node/tasks/centos.yml
  2. +26
    -0
      roles/rudder-node/tasks/debian.yml
  3. +3
    -25
      roles/rudder-node/tasks/main.yml

+ 27
- 0
roles/rudder-node/tasks/centos.yml View File

@ -0,0 +1,27 @@
---
## Install and configure rudder-agent on debian/ubuntu node
- name: add rudder repo key -- centos
rpm_key: key="https://www.rudder-project.org/apt-repos/rudder_apt_key.pub" state=present
when: ansible_distribution == 'CentOS' or ansible_distribution == 'CloudLinux' or ansible_distribution == 'Virtuozzo'
- name: add rudder repo url -- centos
yum_repository:
name: rudder
description: Rudder 4.1 EL repository
file: rudder_repo
baseurl: http://www.rudder-project.org/rpm-4.1/RHEL_$releasever/
gpgcheck: yes
gpgkey: http://www.rudder-project.org/rpm-4.1/RHEL_$releasever/repodata/repomd.xml.key
when: ansible_distribution == 'CentOS' or ansible_distribution == 'CloudLinux' or ansible_distribution == 'Virtuozzo'
- name: install rudder agent -- centos
yum: name=rudder-agent state=present update_cache=yes
when: ansible_distribution == 'CentOS' or ansible_distribution == 'CloudLinux' or ansible_distribution == 'Virtuozzo'
- name: configure rudder server -- centos
template: src=policy_server.dat.tpl dest=/var/rudder/cfengine-community/policy_server.dat
notify:
- rudder-start
- agent-inventory
- agent-run
when: ansible_distribution == 'CentOS' or ansible_distribution == 'CloudLinux' or ansible_distribution == 'Virtuozzo'

+ 26
- 0
roles/rudder-node/tasks/debian.yml View File

@ -0,0 +1,26 @@
---
## Install and configure rudder-agent on debian/ubuntu node
- name: add rudder repo key -- debian
apt_key: url="https://www.rudder-project.org/apt-repos/rudder_apt_key.pub" state=present
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
- name: add rudder repo url -- debian
apt_repository:
repo: 'deb http://www.rudder-project.org/apt-4.1/ {{ansible_distribution_release}} main'
state: present
filename: 'rudder'
update_cache: yes
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
- name: install rudder agent -- debian
apt: pkg=rudder-agent state=present update_cache=yes
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
- name: configure rudder server -- debian
template: src=policy_server.dat.tpl dest=/var/rudder/cfengine-community/policy_server.dat
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
notify:
- rudder-start
- agent-inventory
- agent-run
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'

+ 3
- 25
roles/rudder-node/tasks/main.yml View File

@ -1,30 +1,8 @@
---
## Install and configure rudder-agent on debian/ubuntu node
- name: add rudder repo key
apt_key: url="https://www.rudder-project.org/apt-repos/rudder_apt_key.pub" state=present
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
- name: add rudder repo url
apt_repository:
repo: 'deb http://www.rudder-project.org/apt-4.1/ {{ansible_distribution_release}} main'
state: present
filename: 'rudder'
update_cache: yes
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
- name: install rudder agent
apt: pkg=rudder-agent state=present update_cache=yes
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
- name: configure rudder server
template: src=policy_server.dat.tpl dest=/var/rudder/cfengine-community/policy_server.dat
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
notify:
- rudder-start
- agent-inventory
- agent-run
- include: debian.yml
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
- include: centos.yml
when: ansible_distribution == 'CentOS' or ansible_distribution == 'CloudLinux' or ansible_distribution == 'Virtuozzo'
- fail: msg="You can now connect to your rudder server and allow new nodes"
ignore_errors: yes
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'

Loading…
Cancel
Save