diff --git a/fusiondirectory/defaults/main.yml b/fusiondirectory/defaults/main.yml new file mode 100644 index 0000000..cb0afa2 --- /dev/null +++ b/fusiondirectory/defaults/main.yml @@ -0,0 +1,27 @@ +--- +fusiondirectory_install: False +fusiondirectory_schemas_install: True +# We use the debian wheezy repo for Ubuntu precise and Ubuntu trusty +fusiond_repo: 'deb http://repos.fusiondirectory.org/debian-wheezy wheezy main' +fusiond_extra_repo: 'deb http://repos.fusiondirectory.org/debian-extra wheezy main' +fusiond_repo_key: 62B4981F +fusiond_gpg_repo: keys.gnupg.net + +fusiondirectory_main_pkgs: + - fusiondirectory-archive-keyring + - fusiondirectory + +fusiondirectory_main_plugins: + - fusiondirectory-plugin-nagios + - fusiondirectory-plugin-ldapmanager + - fusiondirectory-plugin-ssh + +fusiondirectory_main_schemas: + - fusiondirectory-plugin-nagios-schema + - fusiondirectory-schema + - fusiondirectory-plugin-ssh-schema + +#fusiondirectory_plugins: + +#fusiondirectory_schemas: + diff --git a/fusiondirectory/tasks/main.yml b/fusiondirectory/tasks/main.yml new file mode 100644 index 0000000..bfd4b6c --- /dev/null +++ b/fusiondirectory/tasks/main.yml @@ -0,0 +1,6 @@ +--- +- include: manage-fd-repos.yml +- include: manage-fd-packages.yml +- include: manage-fd-schemas.yml + when: fusiondirectory_schemas_install + diff --git a/fusiondirectory/tasks/manage-fd-packages.yml b/fusiondirectory/tasks/manage-fd-packages.yml new file mode 100644 index 0000000..84c7999 --- /dev/null +++ b/fusiondirectory/tasks/manage-fd-packages.yml @@ -0,0 +1,35 @@ +--- +- block: + + - name: Install the fusiondirectory main packages + apt: name={{ item }} state=present update_cache=yes + with_items: '{{ fusiondirectory_main_pkgs }}' + + - name: Install the fusiondirectory main plugins + apt: name={{ item }} state=present + with_items: '{{ fusiondirectory_main_plugins }}' + + - name: Install the fusiondirectory additional plugins + apt: name={{ item }} state=present + with_items: '{{ fusiondirectory_plugins | default ([]) }}' + + when: fusiondirectory_install + tags: fusiondirectory + +- block: + + - name: Remove the fusiondirectory main plugins + apt: name={{ item }} state=absent + with_items: '{{ fusiondirectory_main_plugins }}' + + - name: Remove the fusiondirectory additional plugins + apt: name={{ item }} state=absent + with_items: '{{ fusiondirectory_plugins | default ([]) }}' + + - name: Remove the fusiondirectory main packages + apt: name={{ item }} state=absent + with_items: '{{ fusiondirectory_main_pkgs }}' + + when: not fusiondirectory_install + tags: fusiondirectory + diff --git a/fusiondirectory/tasks/manage-fd-repos.yml b/fusiondirectory/tasks/manage-fd-repos.yml new file mode 100644 index 0000000..db86670 --- /dev/null +++ b/fusiondirectory/tasks/manage-fd-repos.yml @@ -0,0 +1,29 @@ +--- +- block: + + - name: Get the Fusion Directory repo key + apt_key: id={{ fusiond_repo_key }} keyserver={{ fusiond_gpg_repo }} + + - name: Install the Fusion Directory repo + apt_repository: repo={{ fusiond_repo }} + + - name: Install the Fusion Directory debian extras repo + apt_repository: repo={{ fusiond_extra_repo }} + + when: fusiondirectory_install + tags: fusiondirectory + +- block: + + - name: Remove the Fusion Directory repo key + apt_key: id={{ fusiond_repo_key }} keyserver={{ fusiond_gpg_repo }} state=absent + + - name: Remove the Fusion Directory repo + apt_repository: repo={{ fusiond_repo }} state=absent + + - name: Remove the Fusion Directory debian extras repo + apt_repository: repo={{ fusiond_extra_repo }} state=absent update_cache=yes + + when: not fusiondirectory_install + tags: fusiondirectory + diff --git a/fusiondirectory/tasks/manage-fd-schemas.yml b/fusiondirectory/tasks/manage-fd-schemas.yml new file mode 100644 index 0000000..1c4328c --- /dev/null +++ b/fusiondirectory/tasks/manage-fd-schemas.yml @@ -0,0 +1,27 @@ +--- +- block: + + - name: Install the fusiondirectory main schemas + apt: name={{ item }} state=present update_cache=yes + with_items: '{{ fusiondirectory_main_schemas }}' + + - name: Install the fusiondirectory additional schemas + apt: name={{ item }} state=present + with_items: '{{ fusiondirectory_schemas | default ([]) }}' + + when: fusiondirectory_schemas_install + tags: [ 'fusiondirectory', 'fd_schemas' ] + +- block: + + - name: Remove the fusiondirectory main schemas + apt: name={{ item }} state=absent + with_items: '{{ fusiondirectory_main_schemas }}' + + - name: Remove the fusiondirectory additional schemas + apt: name={{ item }} state=absent + with_items: '{{ fusiondirectory_schemas | default ([]) }}' + + when: not fusiondirectory_schemas_install + tags: [ 'fusiondirectory', 'fd_schemas' ] +