diff options
-rw-r--r-- | roles/desktop/LICENSE | 19 | ||||
-rw-r--r-- | roles/desktop/README.md | 58 | ||||
-rw-r--r-- | roles/desktop/defaults/main.yml | 3 | ||||
-rw-r--r-- | roles/desktop/meta/main.yml | 23 | ||||
-rw-r--r-- | roles/desktop/tasks/Debian.yml | 7 | ||||
-rw-r--r-- | roles/desktop/tasks/RedHat.yml | 29 | ||||
-rw-r--r-- | roles/desktop/tasks/main.yml | 5 |
7 files changed, 144 insertions, 0 deletions
diff --git a/roles/desktop/LICENSE b/roles/desktop/LICENSE new file mode 100644 index 0000000..f14e71c --- /dev/null +++ b/roles/desktop/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2015 Nathan Sowatskey <nathan@nathan.to> + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/roles/desktop/README.md b/roles/desktop/README.md new file mode 100644 index 0000000..4291cbe --- /dev/null +++ b/roles/desktop/README.md @@ -0,0 +1,58 @@ +Ansible Linux Desktop Role +========================== + +[![Build Status](https://travis-ci.org/smola/ansible-java-role.svg?branch=master)](https://travis-ci.org/smola/ansible-java-role) + +Manages installation of a Linux desktop of choice on RedHat and Debian distributions. +All packages are installed using the package manager. + +Requirements +------------ + +None. + +Role Variables +-------------- + +The main variable is the name of the desktop to be installed. The supported +desktops are listed below: + +# Debian / Ubuntu + +Valid desktops for Debian and Ubuntu are: + +... + +# Fedora/RedHat + +Valid desktops for Fedora and RedHat are: + +... + +# Others + +Got this role working with a different distro? Please, [report it on GitHub](https://github.com/DevOps4Networks/ansible-linux-desktop-role/issues). + +Dependencies +------------ + +None. + +Example Playbook +------------------------- +... +License +------- + +Copyright (c) Nathan Sowatskey <nathan@nathan.to> + +ansible-linux-desktop-role is released under the terms of the MIT License. + + +Acknowledgements +---------------- + +Thanks to [Santiago M. Mola](https://github.com/smola) from whom I have borrowed +some ideas from his [ansible-java-role](https://github.com/smola/ansible-java-role) +and also idea from +[Testing Ansible Roles with Travis CI on GitHub](https://servercheck.in/blog/testing-ansible-roles-travis-ci-github). diff --git a/roles/desktop/defaults/main.yml b/roles/desktop/defaults/main.yml new file mode 100644 index 0000000..8808c12 --- /dev/null +++ b/roles/desktop/defaults/main.yml @@ -0,0 +1,3 @@ +--- +debian_desktop: [] +redhat_desktop: [] diff --git a/roles/desktop/meta/main.yml b/roles/desktop/meta/main.yml new file mode 100644 index 0000000..06a049a --- /dev/null +++ b/roles/desktop/meta/main.yml @@ -0,0 +1,23 @@ +--- +galaxy_info: + author: Nathan Sowatskey + description: Linux desktops - Gnome, KDE, Cinnamon, MATE, Xfce. + license: MIT + min_ansible_version: 1.6.3 + platforms: + - name: Ubuntu + versions: + - all + - name: Debian + versions: + - all + - name: EL + versions: + - all + - name: Fedora + versions: + - all + categories: + - development + - system +dependencies: [] diff --git a/roles/desktop/tasks/Debian.yml b/roles/desktop/tasks/Debian.yml new file mode 100644 index 0000000..2a6bc5c --- /dev/null +++ b/roles/desktop/tasks/Debian.yml @@ -0,0 +1,7 @@ +--- + +- name: Install Debian Gnome desktop + apt: name="@^gnome-desktop-environment" state=present + when: debian_desktop == 'gnome' + + diff --git a/roles/desktop/tasks/RedHat.yml b/roles/desktop/tasks/RedHat.yml new file mode 100644 index 0000000..eaa92ff --- /dev/null +++ b/roles/desktop/tasks/RedHat.yml @@ -0,0 +1,29 @@ +--- + +- debug: var=redhat_desktop + +- name: Install RedHat Gnome desktop + yum: name="@^gnome-desktop-environment" state=present + when: redhat_desktop == 'gnome' or redhat_desktop == 'gnome_shell' + +- name: Install RedHat KDE desktop + yum: name="@^kde-desktop-environment" state=present + when: redhat_desktop == 'kde' + +- name: Install RedHat Cinnamon desktop + #shell: yum --enablerepo=epel -y install cinnamon* x11 + yum: enablerepo=epel name="@^cinnamon*" state=present + when: redhat_desktop == 'cinnamon' + +- name: Install RedHat MATE desktop + #shell: yum --enablerepo=epel -y groupinstall mate-desktop-environment x11 + yum: enablerepo=epel name="@^mate-desktop-environment" state=present + when: redhat_desktop == 'mate' + +- name: Install RedHat Xfce desktop + #shell: yum --enablerepo=epel -y groupinstall xfce-desktop x11 + yum: enablerepo=epel name="@^xfce-desktop" state=present + when: redhat_desktop == 'xfce' + +- name: Install RedHat X11 + yum: name="@x11" state=present diff --git a/roles/desktop/tasks/main.yml b/roles/desktop/tasks/main.yml new file mode 100644 index 0000000..fca07c5 --- /dev/null +++ b/roles/desktop/tasks/main.yml @@ -0,0 +1,5 @@ +--- +- include: Debian.yml + when: ansible_os_family == 'Debian' +- include: RedHat.yml + when: ansible_os_family == 'RedHat' |