File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,8 +10,7 @@ Install [Snap](https://snapcraft.io/) for Linux.
1010 platforms :
1111 - name : Fedora
1212 versions :
13- - 31
14- - 32
13+ - 33
1514 - name : Ubuntu
1615 versions :
1716 - xenial
@@ -37,14 +36,48 @@ None.
3736
3837## Role Variables
3938
40- None.
39+ ` ` ` yaml
40+ # If you *NOT* use apt-cacher-ng or other caching proxy - select "https".
41+ http_or_https : http
42+ ` ` `
4143
4244## Dependencies
4345
4446[min_ansible_version: 2.8](https://docs.ansible.com/ansible/latest/modules/snap_module.html)
4547
48+ ## HowTo
49+
50+ ### How to install role
51+
52+ Over ` ansible-galaxy`:
53+
54+ ` ` ` bash
55+ ansible-galaxy install don_rumata.ansible_role_install_snap
56+ ` ` `
57+
58+ Over `bash+git` :
59+
60+ ` ` ` bash
61+ git clone https://github.com/don-rumata/ansible-role-install-snap don_rumata.ansible_role_install_snap
62+ ` ` `
63+
4664# # Example Playbook
4765
66+ Install latest `snapd` on Linux over package manager of you distro :
67+
68+ `install-snap.yml` :
69+
70+ ` ` ` yaml
71+ - name: Install Snap
72+ hosts: all
73+ strategy: free
74+ serial:
75+ - "100%"
76+ roles:
77+ - don_rumata.ansible_role_install_snap
78+ tasks:
79+ ` ` `
80+
4881`install-firefox-over-snap.yml` :
4982
5083` ` ` yaml
5487 serial:
5588 - "100%"
5689 roles:
57- - ansible-role-install-snap
90+ - don_rumata.ansible_role_install_snap
5891 tasks:
5992
6093 - name: Install FF over snap
Original file line number Diff line number Diff line change 1- ---
1+ ---
2+ # If you *NOT* use apt-cacher-ng or other caching proxy - select "https".
3+ http_or_https : http
4+ # http_or_https: https
Original file line number Diff line number Diff line change @@ -11,8 +11,7 @@ galaxy_info:
1111 platforms :
1212 - name : Fedora
1313 versions :
14- - 32
15- - 31
14+ - 33
1615 - name : Ubuntu
1716 versions :
1817 - focal
Original file line number Diff line number Diff line change 11---
22# https://snapcraft.io/docs/installing-snap-on-centos
3- - name : Add EPEL repo
3+ - name : Add EPEL repo 4 CentOS 7\RHEL
44 when :
55 - ansible_os_family == 'RedHat'
66 - ansible_pkg_mgr == 'yum'
1010 ansible_python_interpreter : /usr/bin/python2.7
1111 become : yes
1212 # https://fedoraproject.org/wiki/EPEL
13- yum :
13+ package :
1414 name :
15- - https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ansible_distribution_major_version }}.noarch.rpm
15+ - epel-release
16+ state : present
17+
18+ - name : Add EPEL repo 4 CentOS 8+\RHEL
19+ when :
20+ - ansible_os_family == 'RedHat'
21+ - ansible_pkg_mgr == 'dnf'
22+ - ansible_distribution != 'Fedora'
23+ become : yes
24+ package :
25+ name :
26+ - epel-release
1627 state : present
1728
1829- name : Install snapd and config service 4 enterprise RHEL-like
2233 become : yes
2334 vars :
2435 ansible_python_interpreter : /usr/bin/python2.7
25- yum :
36+ package :
2637 name :
2738 - snapd
2839 state : present
Original file line number Diff line number Diff line change 44 when :
55 - ansible_system == 'Linux'
66 - ansible_os_family == 'Suse'
7- - ansible_distribution == 'openSUSE Tumbleweed'
87 - ansible_pkg_mgr == 'zypper'
8+ - ansible_distribution == 'openSUSE Tumbleweed'
99 become : yes
1010 zypper_repository :
1111 name : system_snappy
12- repo : " https ://download.opensuse.org/repositories/system:/snappy/{{ ansible_distribution | replace(' ', '_') }}/"
12+ repo : " {{ http_or_https }} ://download.opensuse.org/repositories/system:/snappy/{{ ansible_distribution | replace(' ', '_') }}/"
1313 auto_import_keys : yes
1414 runrefresh : yes
1515 state : present
16- tags :
17- - linux
18- - snap
19- - install
20- - suse
21- - opensuse
22- - zypper
23- - rpm
2416
2517- name : Add repo snapd 4 OpenSUSE Leap
2618 when :
2719 - ansible_system == 'Linux'
2820 - ansible_os_family == 'Suse'
29- - ansible_distribution == 'openSUSE Leap'
3021 - ansible_pkg_mgr == 'zypper'
22+ - ansible_distribution == 'openSUSE Leap'
3123 become : yes
3224 zypper_repository :
3325 name : system_snappy
34- repo : " https ://download.opensuse.org/repositories/system:/snappy/{{ ansible_distribution | replace(' ', '_') }}_{{ ansible_distribution_version }}/"
26+ repo : " {{ http_or_https }} ://download.opensuse.org/repositories/system:/snappy/{{ ansible_distribution | replace(' ', '_') }}_{{ ansible_distribution_version }}/"
3527 auto_import_keys : yes
3628 runrefresh : yes
3729 state : present
38- tags :
39- - linux
40- - snap
41- - install
42- - suse
43- - opensuse
44- - zypper
45- - rpm
Original file line number Diff line number Diff line change 1717 notify :
1818 - start-snapd-socket
1919 - start-snapd-apparmor
20- tags :
21- - linux
22- - snap
23- - install
24- - debian
25- - ubuntu
26- - deb
2720
2821- name : Enable and start snapd service 4 any Linux distros
2922 when :
3427 name : snapd
3528 state : started
3629 enabled : yes
37- tags :
38- - linux
39- - snap
40- - service
4130
4231- name : Get status about /snap 4 any Linux distros
4332 when :
4635 stat :
4736 path : /snap
4837 register : root_snap_present
49- tags :
50- - linux
51- - snap
52- - symlink
53- - ln
5438
5539# https://snapcraft.io/docs/installing-snap-on-red-hat
5640- name : Create snapd symlink 4 any Linux distros
6246 src : /var/lib/snapd/snap
6347 dest : /snap
6448 state : link
65- tags :
66- - linux
67- - snap
68- - symlink
69- - ln
You can’t perform that action at this time.
0 commit comments