From 5e9874bdb839d6111d912fe421927599d1a4cbc0 Mon Sep 17 00:00:00 2001 From: Jan Beilicke Date: Sat, 27 Mar 2021 14:43:38 +0100 Subject: [PATCH 1/3] Removed redundant tasks include --- tasks/main.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index c4021ff..f6fd587 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -8,14 +8,6 @@ - sublime_text when: ansible_facts['os_family'] == 'Debian' -- name: Provide dev-tools (on Debian) - include_tasks: - file: sublime_text_debian.yml - apply: - tags: - - sublime_text - when: ansible_facts['os_family'] == 'Debian' - - name: Provide dev-tools (on Archlinux) include_tasks: file: sublime_text_archlinux.yml From 78e2112ba64fa3f5dbd1472554db02b5781e8eef Mon Sep 17 00:00:00 2001 From: Jan Beilicke Date: Sat, 27 Mar 2021 14:47:43 +0100 Subject: [PATCH 2/3] Refactored task to install Sublime Text --- tasks/main.yml | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index f6fd587..2f08c86 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,18 +1,8 @@ --- # tasks file for jotbe.dev-tools -- name: Provide dev-tools (on Debian) +- name: Install Sublime Text include_tasks: - file: sublime_text_debian.yml + file: sublime_text_{{ ansible_facts['os_family'] | lower }}.yml apply: tags: - sublime_text - when: ansible_facts['os_family'] == 'Debian' - -- name: Provide dev-tools (on Archlinux) - include_tasks: - file: sublime_text_archlinux.yml - apply: - tags: - - sublime_text - when: - - ansible_facts['os_family'] == 'Archlinux' From 527814829cae359d855fa1a0111ca8d0092f0d26 Mon Sep 17 00:00:00 2001 From: Jan Beilicke Date: Sat, 27 Mar 2021 14:58:32 +0100 Subject: [PATCH 3/3] Make installation of Sublime Text optional; Updated README --- README.md | 27 +++++++++++++-------------- defaults/main.yml | 3 ++- tasks/main.yml | 1 + 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 225dd44..ff7ae7c 100644 --- a/README.md +++ b/README.md @@ -1,38 +1,37 @@ -Role Name -========= - -A brief description of the role goes here. +Ansible Role: jotbe.dev_tools +============================= Requirements ------------ -Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. - Role Variables -------------- -A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. +```yaml +# default variables +enable_sublime_text: yes + +``` Dependencies ------------ -A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. - Example Playbook ---------------- -Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: +Create a playbook containing e.g.: - - hosts: servers + - hosts: devvm roles: - - { role: username.rolename, x: 42 } + - { role: jotbe.dev_tools, enable_sublime_text: no } License ------- -BSD +MIT Author Information ------------------ -An optional section for the role authors to include contact information, or a website (HTML is not allowed). +This role was created in 2020 by [Jan Beilicke](https://jotbe.io). + diff --git a/defaults/main.yml b/defaults/main.yml index d031dcc..83f09f8 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,2 +1,3 @@ --- -# defaults file for jotbe.dev-tools \ No newline at end of file +# defaults file for jotbe.dev-tools +enable_sublime_text: yes \ No newline at end of file diff --git a/tasks/main.yml b/tasks/main.yml index 2f08c86..70bc39d 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -6,3 +6,4 @@ apply: tags: - sublime_text + when: enable_sublime_text