From ff3c016c94c5353b983da651a89842c32d3a5412 Mon Sep 17 00:00:00 2001 From: Sebastien Thebert Date: Tue, 11 Oct 2022 00:08:23 +0200 Subject: [PATCH] Initial commit --- README.md | 42 +++++++++++++++++++++++++++++++++++++++++ meta/argument_specs.yml | 13 +++++++++++++ meta/main.yml | 18 ++++++++++++++++++ tasks/main.yml | 16 ++++++++++++++++ 4 files changed, 89 insertions(+) create mode 100644 README.md create mode 100644 meta/argument_specs.yml create mode 100644 meta/main.yml create mode 100644 tasks/main.yml diff --git a/README.md b/README.md new file mode 100644 index 0000000..78a5fc8 --- /dev/null +++ b/README.md @@ -0,0 +1,42 @@ +# Ansible Role : ubuntu_pro + +An Ansible Role that registers host on [Ubuntu Pro](https://ubuntu.com/pro). + +## Requirements + +Ansible Pro is only available for every Ubuntu LTS releases from 16.04 LTS. + +## Roles Variables + +The only mandatory variable for this role is `ubuntu_pro_token`. + +```yaml +ubuntu_pro_token: +``` + +## Dependencies + +None. + +## Example Playbook + +`ansible-playbook -i inventory.ini -e ubuntu_pro_token= ubuntu_pro.yml` + +with `ubuntu_pro.yml` : + +```yaml +# ubuntu_pro.yml +- hosts: ubuntu_servers + + roles: + - sebthebert.ubuntu_pro + +``` + +## License + +MIT / BSD + +## Author Information + +This role was created in October 2022 by [Sebastien Thebert](https://github.com/sebthebert). \ No newline at end of file diff --git a/meta/argument_specs.yml b/meta/argument_specs.yml new file mode 100644 index 0000000..473904d --- /dev/null +++ b/meta/argument_specs.yml @@ -0,0 +1,13 @@ +--- +argument_specs: + main: + short_description: Register host on Ubuntu Pro (https://ubuntu.com/pro) + description: + - The main entry point just combines the repositories and packages + entry points. + options: + ubuntu_pro_token: + description: + - Ubuntu Pro token + type: str + required: true diff --git a/meta/main.yml b/meta/main.yml new file mode 100644 index 0000000..c160271 --- /dev/null +++ b/meta/main.yml @@ -0,0 +1,18 @@ +--- +galaxy_info: + role_name: ubuntu_pro + author: sebthebert + description: Register host on Ubuntu Pro + issue_tracker_url: https://github.com/sebthebert/ansible-role-ubuntu_pro/issues + license: "license (BSD, MIT)" + min_ansible_version: "2.11" + platforms: + - name: Ubuntu + versions: + - all + galaxy_tags: + - system + - ubuntu + - ubuntu-pro + +dependencies: [] diff --git a/tasks/main.yml b/tasks/main.yml new file mode 100644 index 0000000..73b1751 --- /dev/null +++ b/tasks/main.yml @@ -0,0 +1,16 @@ +--- +- name: Launch 'apt update' + ansible.builtin.apt: + update_cache: yes + +- name: Launch 'apt upgrade' + ansible.builtin.apt: + upgrade: yes + +- name: Register this host on Ubuntu Pro (pro attach ) + command: pro attach {{ ubuntu_pro_token }} + become: yes + register: reg_pro_attach + +- debug: + var: reg_pro_attach