Skip to content

Commit

Permalink
fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
stdevel committed Mar 7, 2023
1 parent aaaf520 commit dfcc799
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ sudo: false
addons:
apt:
packages:
- python3-pip
- python3-pip

install:
# Install ansible
Expand Down
2 changes: 1 addition & 1 deletion handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
# handlers file for landscape
# handlers file for landscape
5 changes: 4 additions & 1 deletion meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
galaxy_info:
namespace: stdevel
role_name: landscape
author: Christian Stankowic
description: Installs Canonical Landscape
license: Apache-2.0

min_ansible_version: 2.9
min_ansible_version: '2.9'

platforms:
- name: Ubuntu
versions:
- xenial
- bionic
- focal
- jammy

galaxy_tags:
- systemsmanagement
Expand Down
6 changes: 4 additions & 2 deletions tasks/check.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
---
- name: Ensure having supported Ubuntu release for 19.10
fail: msg="Please install supported Ubuntu release"
ansible.builtin.fail:
msg: Please install supported Ubuntu release
when:
- landscape_version == '19.10'
- ansible_distribution_version not in ['16.04', '18.04']

- name: Ensure having supported Ubuntu release for 23.03
fail: msg="Please install supported Ubuntu release"
ansible.builtin.fail:
msg: Please install supported Ubuntu release
when:
- landscape_version == '23.03'
- ansible_distribution_version not in ['20.04', '22.04']
4 changes: 2 additions & 2 deletions tasks/install.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
- name: Install Landscape packages
apt:
ansible.builtin.apt:
name: "{{ landscape_packages }}"
update_cache: yes
update_cache: true
become: true
12 changes: 8 additions & 4 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
- include_vars: "{{ lookup('ansible.builtin.first_found', params) }}"
- name: Include variables
ansible.builtin.include_vars: "{{ lookup('ansible.builtin.first_found', params) }}"
vars:
params:
files:
Expand All @@ -8,11 +9,14 @@
paths:
- 'vars'

- include_tasks: check.yml
- name: Include check tasks
ansible.builtin.include_tasks: check.yml
tags: check

- include_tasks: prepare.yml
- name: Include prepare tasks
ansible.builtin.include_tasks: prepare.yml
tags: prepare

- include_tasks: install.yml
- name: Include install tasks
ansible.builtin.include_tasks: install.yml
tags: install
24 changes: 12 additions & 12 deletions tasks/prepare.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
---
- name: Install core utilities
apt:
ansible.builtin.apt:
name: "{{ landscape_core_packages }}"
state: present
become: true

- name: Create a volume group for Landscape
lvg:
community.general.lvg:
vg: "{{ landscape_vg }}"
pvs: "{{ landscape_pv }}"
become: true
when: landscape_use_lvm | bool

- name: Create logical volumes, file systems and mount points
become: true
when: landscape_use_lvm | bool
block:
- name: Create logical volumes
lvol:
community.general.lvol:
vg: "{{ landscape_vg }}"
lv: "{{ item.name }}"
size: "{{ item.size }}"
with_items: "{{ landscape_filesystems }}"
- name: Create file systems
filesystem:
loop: "{{ landscape_filesystems }}"
- name: Create file systems # noqa: args[module]
community.general.filesystem:
fstype: "{{ item.type }}"
dev: "/dev/mapper/{{ landscape_vg }}-{{ item.name }}"
with_items: "{{ landscape_filesystems }}"
loop: "{{ landscape_filesystems }}"
- name: Create mount points
mount:
ansible.posix.mount:
path: "{{ item.mountpoint }}"
src: "/dev/mapper/{{ landscape_vg }}-{{ item.name }}"
fstype: "{{ item.type }}"
opts: auto
state: mounted
with_items: "{{ landscape_filesystems }}"
become: true
when: landscape_use_lvm | bool
loop: "{{ landscape_filesystems }}"

- name: Add Landscape PPA
apt_repository:
ansible.builtin.apt_repository:
repo: "{{ landscape_ppa }}"
become: true
2 changes: 1 addition & 1 deletion tests/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
- hosts: localhost
remote_user: root
roles:
- ansible-landscape
- ansible-landscape

0 comments on commit dfcc799

Please sign in to comment.