From 912ab3ff61b55cd6cb58b3cde495353b350f416a Mon Sep 17 00:00:00 2001 From: Ronggo Radityo Date: Tue, 25 Sep 2018 19:34:38 +0700 Subject: [PATCH] Pembuatan fungsi awal --- meta/main.yml | 52 ++++++++++++-------------------------------------- tasks/main.yml | 21 +++++++++++++++++++- 2 files changed, 32 insertions(+), 41 deletions(-) diff --git a/meta/main.yml b/meta/main.yml index 7223799..396db6e 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -1,56 +1,28 @@ galaxy_info: - author: your name - description: your description - company: your company (optional) + author: Ronggo Radityo + description: Update Debian Server + company: Kota Magelang # If the issue tracker for your role is not on github, uncomment the # next line and provide a value # issue_tracker_url: http://example.com/issue/tracker - # Some suggested licenses: - # - BSD (default) - # - MIT - # - GPLv2 - # - GPLv3 - # - Apache - # - CC-BY - license: license (GPLv2, CC-BY, etc) + license: license (BSD, MIT) min_ansible_version: 1.2 - # If this a Container Enabled role, provide the minimum Ansible Container version. - # min_ansible_container_version: - - # Optionally specify the branch Galaxy will use when accessing the GitHub - # repo for this role. During role install, if no tags are available, - # Galaxy will use this branch. During import Galaxy will access files on - # this branch. If Travis integration is configured, only notifications for this - # branch will be accepted. Otherwise, in all cases, the repo's default branch - # (usually master) will be used. - #github_branch: - # # platforms is a list of platforms, and each platform has a name and a list of versions. # - # platforms: - # - name: Fedora - # versions: - # - all - # - 25 - # - name: SomePlatform - # versions: - # - all - # - 1.0 - # - 7 - # - 99.99 + platforms: + - name: Debian + versions: + - 8 + - 9 - galaxy_tags: [] - # List tags for your role here, one per line. A tag is a keyword that describes - # and categorizes the role. Users find roles by searching for tags. Be sure to - # remove the '[]' above, if you add tags to this list. - # - # NOTE: A tag is limited to a single word comprised of alphanumeric characters. - # Maximum 20 tags per role. + galaxy_tags: + - linux + - debian dependencies: [] # List your role dependencies here, one per line. Be sure to remove the '[]' above, diff --git a/tasks/main.yml b/tasks/main.yml index b693df9..1d4522c 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,2 +1,21 @@ --- -# tasks file for roles/debian-update \ No newline at end of file +# tasks file for roles/debian-update +- name: Update packages list + apt: + update_cache: yes + when: ansible_os_family == 'Debian' + +- name: Upgrade packages + apt: + upgrade: yes + when: ansible_os_family == 'Debian' + +- name: Remove dependencies that are no longer required + apt: + autoremove: yes + when: ansible_os_family == 'Debian' + +- name: Remove useless packages from the cache + apt: + autoclean: yes + when: ansible_os_family == 'Debian'