From 6d40776f4227fddfd843b82c529f1b4d1429bfc8 Mon Sep 17 00:00:00 2001 From: Christian Stankowic Date: Fri, 31 Jul 2020 13:27:03 +0200 Subject: [PATCH 01/15] set check to SP2 for Uyuni --- tasks/check.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tasks/check.yml b/tasks/check.yml index 12cb99d..187a1b2 100644 --- a/tasks/check.yml +++ b/tasks/check.yml @@ -1,4 +1,4 @@ --- -- name: Ensure having 15 SP1 release - fail: msg="Please upgrade to SP1" - when: "ansible_distribution_version != '15.1'" +- name: Ensure having 15 SP2 release + fail: msg="Please upgrade to SP2" + when: "ansible_distribution_version != '15.2'" From c19adf4e33299b824beadfe2d827e04e8659d260 Mon Sep 17 00:00:00 2001 From: Christian Stankowic Date: Fri, 31 Jul 2020 14:03:55 +0200 Subject: [PATCH 02/15] split SP check for openSUSE and SLES As SUSE Manager 4.0 (based on SLE 15 SP1) is still supported until June 2021, the SP check must be different from openSUSE. Also, some users might want to install an older release of SUSE Manager 4. --- README.md | 1 + defaults/main.yml | 1 + molecule/default/molecule.yml | 2 +- tasks/{check.yml => check_opensuse_leap.yml} | 1 + tasks/check_sles.yml | 13 +++++++++++++ tasks/main.yml | 2 +- 6 files changed, 18 insertions(+), 2 deletions(-) rename tasks/{check.yml => check_opensuse_leap.yml} (99%) create mode 100644 tasks/check_sles.yml diff --git a/README.md b/README.md index 9243e6c..4e79680 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ The system needs access to the internet. Also, you will need an openSUSE Leap or | Variable | Default | Description | | -------- | ------- | ----------- | +| `suma_release` | `4.1` | SUSE Manager release to install (*4.0 or 4.1*) | | `scc_reg_code` | - | [SUSE Customer Center](https://scc.suse.com) registration code (*received after trial registration or purchase*) | | `scc_mail` | - | SUSE Customer Center mail address | | `scc_check_registration` | `true` | Register system if unregistered | diff --git a/defaults/main.yml b/defaults/main.yml index cd8172e..70dd6af 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -9,6 +9,7 @@ uyuni_repo: "https://download.opensuse.org/repositories/systemsmanagement:/Uyuni uyuni_packages: - spacewalk-utils - spacecmd +suma_release: 4.1 scc_check_registration: true scc_check_modules: true sles_modules: diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index ec29d7d..bdf5c91 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -10,7 +10,7 @@ lint: | ansible-lint flake8 platforms: - - name: opensuse-leap151 + - name: opensuse-leap15 box: generic/opensuse15 box_version: "3.0.10" cpus: 2 diff --git a/tasks/check.yml b/tasks/check_opensuse_leap.yml similarity index 99% rename from tasks/check.yml rename to tasks/check_opensuse_leap.yml index 187a1b2..ca2a0f3 100644 --- a/tasks/check.yml +++ b/tasks/check_opensuse_leap.yml @@ -2,3 +2,4 @@ - name: Ensure having 15 SP2 release fail: msg="Please upgrade to SP2" when: "ansible_distribution_version != '15.2'" + diff --git a/tasks/check_sles.yml b/tasks/check_sles.yml new file mode 100644 index 0000000..b236cc8 --- /dev/null +++ b/tasks/check_sles.yml @@ -0,0 +1,13 @@ +--- +- name: Ensure having supported SP release for SUMA 4.0 + fail: msg="Please upgrade to SP1" + when: + - "{{ suma_release }} == '4.0'" + - "ansible_distribution_version != '15.1'" + +- name: Ensure having supported SP release for SUMA 4.1 + fail: msg="Please upgrade to SP1" + when: + - "{{ suma_release }} == '4.1'" + - "ansible_distribution_version != '15.2'" + diff --git a/tasks/main.yml b/tasks/main.yml index c2481f8..7f6bb5a 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -2,7 +2,7 @@ - name: Include variables include_vars: "{{ ansible_distribution | regex_replace(' ', '_') | lower }}.yml" -- include_tasks: "check.yml" +- include_tasks: "check_{{ ansible_distribution | regex_replace(' ', '_') | lower }}.yml" tags: prepare - include_tasks: "prepare_{{ ansible_distribution | regex_replace(' ', '_') | lower }}.yml" From c87e413f2ed5b6b3b7890edfe41f7d86e69869ca Mon Sep 17 00:00:00 2001 From: Christian Stankowic Date: Fri, 31 Jul 2020 15:30:21 +0200 Subject: [PATCH 03/15] add note about missing python-xml package --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 4e79680..2c9edb9 100644 --- a/README.md +++ b/README.md @@ -108,6 +108,17 @@ Don't forget setting SUSE-related variables when deploying SUSE Manager: scc_mail: bla@foo.bar ``` +## Common issues + +Error when running the playbook: + +```shell +TASK [ansible-uyuni : Add Uyuni repository] ************************************ +An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ImportError: No module named xml.dom.minidom +``` + +Install the missing `python-xml` package. + ## License Apache 2.0 From 8e0b33910600d28c44eb9d24a24263465e2b911d Mon Sep 17 00:00:00 2001 From: Christian Stankowic Date: Fri, 31 Jul 2020 15:30:39 +0200 Subject: [PATCH 04/15] add note about SLE SP2 Vagrantboxes --- molecule/README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/molecule/README.md b/molecule/README.md index a55844b..694ae38 100644 --- a/molecule/README.md +++ b/molecule/README.md @@ -37,6 +37,14 @@ You might want to have a look at these sites in order to find out how to create - https://github.com/lavabit/robox - https://github.com/chef/bento/tree/master/packer_templates/sles +Beginning with SLE 15 SP2, SUSE ships Vagrantboxes again. To import it, use the following command: + +```shell +$ vagrant box add sles15-sp2 SLES15-SP2-Vagrant.x86_64-15.2--GM.vagrant..box +``` + +Replace `` with `virtualbox` or `libvirt`. + ## Usage In order to create the test environment execute the following command: @@ -62,3 +70,5 @@ Verifier completed successfully. ``` For running tests in the `suma` scenario context, run the commands above with the `-s suma` parameter. + +When creating your own Vagrantbox, you will need to edit `suma/molecule/molecule.yml` and change the name. From 4a5138c0ba18f0f9d486ccb478d96fc5ceacca2b Mon Sep 17 00:00:00 2001 From: Christian Stankowic Date: Fri, 31 Jul 2020 16:02:18 +0200 Subject: [PATCH 05/15] don't use second HDD any more --- molecule/default/converge.yml | 1 + molecule/default/molecule.yml | 5 ----- molecule/suma/converge.yml | 5 +++-- molecule/suma/molecule.yml | 7 +------ 4 files changed, 5 insertions(+), 13 deletions(-) diff --git a/molecule/default/converge.yml b/molecule/default/converge.yml index a7b5dfd..6628d85 100644 --- a/molecule/default/converge.yml +++ b/molecule/default/converge.yml @@ -3,6 +3,7 @@ hosts: all roles: - role: ansible-uyuni + use_lvm: false config_firewall: false setup_cefs: true setup_cefs_cronjob: true diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index bdf5c91..cf6600d 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -3,8 +3,6 @@ dependency: name: galaxy driver: name: vagrant - provider: - name: virtualbox lint: | yamllint . ansible-lint @@ -15,9 +13,6 @@ platforms: box_version: "3.0.10" cpus: 2 memory: 4096 - provider_raw_config_args: - - "customize ['createhd', '--filename', 'uyuni01.vdi', '--size', 50 * 1024]" - - "customize ['storageattach', :id, '--storagectl', 'IDE Controller', '--port', 1, '--device', 0, '--type', 'hdd', '--medium', 'uyuni01.vdi']" provisioner: name: ansible verifier: diff --git a/molecule/suma/converge.yml b/molecule/suma/converge.yml index 90abf78..c2702e3 100644 --- a/molecule/suma/converge.yml +++ b/molecule/suma/converge.yml @@ -3,8 +3,9 @@ hosts: all roles: - role: ansible-uyuni - scc_reg_code: - scc_mail: + use_lvm: false + scc_reg_code: "" + scc_mail: "" config_firewall: false setup_cefs: true setup_cefs_cronjob: true diff --git a/molecule/suma/molecule.yml b/molecule/suma/molecule.yml index 85c3f3b..fd359d6 100644 --- a/molecule/suma/molecule.yml +++ b/molecule/suma/molecule.yml @@ -3,20 +3,15 @@ dependency: name: galaxy driver: name: vagrant - provider: - name: virtualbox lint: | yamllint . ansible-lint flake8 platforms: - name: suma4 - box: suma4 + box: sles15-sp2 cpus: 2 memory: 4096 - provider_raw_config_args: - - "customize ['createhd', '--filename', 'uyuni02.vdi', '--size', 50 * 1024]" - - "customize ['storageattach', :id, '--storagectl', 'SATA', '--port', 2, '--device', 0, '--type', 'hdd', '--medium', 'uyuni02.vdi']" provisioner: name: ansible verifier: From c0be1700ccf362ca4ab85622ff51b8305270b401 Mon Sep 17 00:00:00 2001 From: Christian Stankowic Date: Fri, 31 Jul 2020 16:23:32 +0200 Subject: [PATCH 06/15] fix linting --- .markdownlint.yml | 4 ++++ .yamllint.yml | 3 +++ molecule/README.md | 23 +++++++++++++++++------ tasks/check_opensuse_leap.yml | 1 - tasks/check_sles.yml | 1 - tasks/install.yml | 2 +- tasks/prepare.yml | 2 +- 7 files changed, 26 insertions(+), 10 deletions(-) create mode 100644 .markdownlint.yml create mode 100644 .yamllint.yml diff --git a/.markdownlint.yml b/.markdownlint.yml new file mode 100644 index 0000000..0d03183 --- /dev/null +++ b/.markdownlint.yml @@ -0,0 +1,4 @@ +--- +"MD013": false # line-length +"MD014": false # show commands output +"MD041": false # first line should be heading (build status image) diff --git a/.yamllint.yml b/.yamllint.yml new file mode 100644 index 0000000..0c01e2b --- /dev/null +++ b/.yamllint.yml @@ -0,0 +1,3 @@ +--- +rules: + line-length: disable diff --git a/molecule/README.md b/molecule/README.md index 694ae38..5acaa6b 100644 --- a/molecule/README.md +++ b/molecule/README.md @@ -1,8 +1,11 @@ # molecule + This folder contains molecule configuration and tests. ## Preparation + Ensure to the following installed: + - [Vagrant](https://vagrantup.com) - [Oracle VirtualBox](https://virtualbox.org) - Python modules @@ -11,17 +14,21 @@ Ensure to the following installed: - [`python-vagrant`](https://pypi.org/project/python-vagrant/) ## Environment + The test environment consists of two test scenarios: + - `default` - default scenario with VM running openSUSE Leap 15.1 - `suma` - SUSE Manager 4.x scenario with VM running SUSE Linux Enterprise Server 15 SP1 ### SUSE hints + In order to run tests against SUSE Linux Enterprise Server 15 SP1 / SUSE Manager 4.x you will either require a valid subscription or a trial license. You can request a [60-day trial on the SUSE website.](https://www.suse.com/products/suse-manager/download/) For this, you will need to create a [SUSE Customer Center](https://scc.suse.com) account - you will **not** be able to request an additional trial for the same release after the 60 days have expired. When using SLES, alter ``suma/converge.yml`` like this: -``` + +```yml --- - name: Converge machines hosts: all @@ -34,8 +41,9 @@ When using SLES, alter ``suma/converge.yml`` like this: Also, you will need a SLES Vagrant box. As the [SUSE End-user license agreement](https://www.suse.com/licensing/eula/download/sles/sles15sp1-en-us.pdf) for SLES 15 SP1 does not allow re-distributing binary releases, I'm unable to provide you a Vagrant box. You might want to have a look at these sites in order to find out how to create SLE 15 Vagrant boxes: -- https://github.com/lavabit/robox -- https://github.com/chef/bento/tree/master/packer_templates/sles + +- [https://github.com/lavabit/robox](https://github.com/lavabit/robox) +- [https://github.com/chef/bento/tree/master/packer_templates/sles](https://github.com/chef/bento/tree/master/packer_templates/sles) Beginning with SLE 15 SP2, SUSE ships Vagrantboxes again. To import it, use the following command: @@ -46,19 +54,22 @@ $ vagrant box add sles15-sp2 SLES15-SP2-Vagrant.x86_64-15.2--GM.vagran Replace `` with `virtualbox` or `libvirt`. ## Usage + In order to create the test environment execute the following command: -``` +```shell $ molecule create ``` Run the Ansible role: -``` + +```shell $ molecule converge ``` Finally, run the tests: -``` + +```shell $ molecule verify ... collected 8 items diff --git a/tasks/check_opensuse_leap.yml b/tasks/check_opensuse_leap.yml index ca2a0f3..187a1b2 100644 --- a/tasks/check_opensuse_leap.yml +++ b/tasks/check_opensuse_leap.yml @@ -2,4 +2,3 @@ - name: Ensure having 15 SP2 release fail: msg="Please upgrade to SP2" when: "ansible_distribution_version != '15.2'" - diff --git a/tasks/check_sles.yml b/tasks/check_sles.yml index b236cc8..bc10e35 100644 --- a/tasks/check_sles.yml +++ b/tasks/check_sles.yml @@ -10,4 +10,3 @@ when: - "{{ suma_release }} == '4.1'" - "ansible_distribution_version != '15.2'" - diff --git a/tasks/install.yml b/tasks/install.yml index b15d127..7c59492 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -34,7 +34,7 @@ url: https://localhost/rhn/newlogin/CreateFirstUser.do method: POST validate_certs: false - body: "submitted=true&orgName={{ org_name }}&login={{ org_login }}&desiredpassword={{ org_password }}&desiredpasswordConfirm={{ org_password }}&email={{ org_mail }}&firstNames={{ org_first_name }}&lastName={{ org_last_name }}" + body: "submitted=true&orgName={{ org_name }}&login={{ org_login }}&desiredpassword={{ org_password }}&desiredpasswordConfirm={{ org_password }}&email={{ org_mail }}&firstNames={{ org_first_name }}&lastName={{ org_last_name }}" # noqa: 204 body_format: "form-urlencoded" status_code: - 201 diff --git a/tasks/prepare.yml b/tasks/prepare.yml index ae5babb..1036ca4 100644 --- a/tasks/prepare.yml +++ b/tasks/prepare.yml @@ -1,5 +1,5 @@ --- -- name: Update system +- name: Update system # noqa: 403 zypper: name: "*" state: latest From 0e3cd052db137a5fa0b921ed5276445f6448b125 Mon Sep 17 00:00:00 2001 From: Christian Stankowic Date: Fri, 31 Jul 2020 16:40:44 +0200 Subject: [PATCH 07/15] make SLE modules modular --- defaults/main.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 70dd6af..2b1509e 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -14,15 +14,15 @@ scc_check_registration: true scc_check_modules: true sles_modules: - name: sle-module-basesystem - identifier: sle-module-basesystem/15.1/x86_64 + identifier: "sle-module-basesystem/{{ ansible_distribution_version }}/x86_64" - name: sle-module-python2 - identifier: sle-module-python2/15.1/x86_64 + identifier: "sle-module-python2/{{ ansible_distribution_version }}/x86_64" - name: sle-module-suse-manager-server - identifier: sle-module-suse-manager-server/4.0/x86_64 + identifier: "sle-module-suse-manager-server/{{ suma_release }}/x86_64" - name: sle-module-server-applications - identifier: sle-module-server-applications/15.1/x86_64 + identifier: "sle-module-server-applications/{{ ansible_distribution_version }}/x86_64" - name: sle-module-web-scripting - identifier: sle-module-web-scripting/15.1/x86_64 + identifier: "sle-module-web-scripting/{{ ansible_distribution_version }}/x86_64" # storage configuration use_lvm: true From 250c312cf68717919da9979542871e58f5988025 Mon Sep 17 00:00:00 2001 From: Christian Stankowic Date: Wed, 23 Sep 2020 17:09:56 +0200 Subject: [PATCH 08/15] pin openSUSE box to newest SP2 release --- molecule/default/molecule.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index cf6600d..0d4bfbb 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -10,7 +10,7 @@ lint: | platforms: - name: opensuse-leap15 box: generic/opensuse15 - box_version: "3.0.10" + box_version: "3.0.22" cpus: 2 memory: 4096 provisioner: From 851ce01046a1e2eda2e4f427c9ef7eecb19d243f Mon Sep 17 00:00:00 2001 From: Christian Stankowic Date: Wed, 23 Sep 2020 17:10:07 +0200 Subject: [PATCH 09/15] change SLE 15.2 box name to offical name --- molecule/suma/molecule.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/molecule/suma/molecule.yml b/molecule/suma/molecule.yml index fd359d6..20b630c 100644 --- a/molecule/suma/molecule.yml +++ b/molecule/suma/molecule.yml @@ -9,7 +9,7 @@ lint: | flake8 platforms: - name: suma4 - box: sles15-sp2 + box: sles15-sp2-GM cpus: 2 memory: 4096 provisioner: From 41d0a4336c04877d0d3663ba2851a6c5f0e97b17 Mon Sep 17 00:00:00 2001 From: Christian Stankowic Date: Wed, 23 Sep 2020 17:31:01 +0200 Subject: [PATCH 10/15] fix incorrect module order (see also issue #22) --- defaults/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 2b1509e..87a29fd 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -17,12 +17,12 @@ sles_modules: identifier: "sle-module-basesystem/{{ ansible_distribution_version }}/x86_64" - name: sle-module-python2 identifier: "sle-module-python2/{{ ansible_distribution_version }}/x86_64" + - name: sle-module-web-scripting + identifier: "sle-module-web-scripting/{{ ansible_distribution_version }}/x86_64" - name: sle-module-suse-manager-server identifier: "sle-module-suse-manager-server/{{ suma_release }}/x86_64" - name: sle-module-server-applications identifier: "sle-module-server-applications/{{ ansible_distribution_version }}/x86_64" - - name: sle-module-web-scripting - identifier: "sle-module-web-scripting/{{ ansible_distribution_version }}/x86_64" # storage configuration use_lvm: true From 16ddb30de4e96f3f59c3cbbdde7514512750d2a9 Mon Sep 17 00:00:00 2001 From: Christian Stankowic Date: Wed, 23 Sep 2020 17:31:27 +0200 Subject: [PATCH 11/15] disabled dedicated HDD for molecule --- molecule/default/vars/main.yml | 13 +------------ molecule/suma/vars/main.yml | 13 +------------ 2 files changed, 2 insertions(+), 24 deletions(-) diff --git a/molecule/default/vars/main.yml b/molecule/default/vars/main.yml index 0280870..209145e 100644 --- a/molecule/default/vars/main.yml +++ b/molecule/default/vars/main.yml @@ -11,18 +11,7 @@ uyuni_packages: - spacecmd # storage configuration -use_lvm: true -vg_uyuni: vg_uyuni -pv_uyuni: /dev/sdb -filesystems: - - name: lv_spacewalk - type: xfs - mountpoint: /var/spacewalk - size: 10240 - - name: lv_pgsql - type: xfs - mountpoint: /var/lib/pgsql - size: 10240 +use_lvm: false # Uyuni configuration org_name: "Demo" diff --git a/molecule/suma/vars/main.yml b/molecule/suma/vars/main.yml index 682bd37..5a0bc64 100644 --- a/molecule/suma/vars/main.yml +++ b/molecule/suma/vars/main.yml @@ -11,18 +11,7 @@ uyuni_packages: - spacecmd # storage configuration -use_lvm: true -vg_uyuni: vg_uyuni -pv_uyuni: /dev/sdb -filesystems: - - name: lv_spacewalk - type: xfs - mountpoint: /var/spacewalk - size: 10240 - - name: lv_pgsql - type: xfs - mountpoint: /var/lib/pgsql - size: 10240 +use_lvm: false # Uyuni configuration org_name: "Demo" From cede07ed483990ae3e6a9464174081183d46e3a9 Mon Sep 17 00:00:00 2001 From: Christian Stankowic Date: Wed, 23 Sep 2020 18:15:12 +0200 Subject: [PATCH 12/15] add support for JeOS (see also issue #23) --- molecule/README.md | 8 +++++--- tasks/check_sles.yml | 10 +++++----- tasks/prepare_sles.yml | 15 ++++++++++++++- 3 files changed, 24 insertions(+), 9 deletions(-) diff --git a/molecule/README.md b/molecule/README.md index 5acaa6b..6d5da0e 100644 --- a/molecule/README.md +++ b/molecule/README.md @@ -17,12 +17,12 @@ Ensure to the following installed: The test environment consists of two test scenarios: -- `default` - default scenario with VM running openSUSE Leap 15.1 -- `suma` - SUSE Manager 4.x scenario with VM running SUSE Linux Enterprise Server 15 SP1 +- `default` - default scenario with VM running openSUSE Leap 15.2 +- `suma` - SUSE Manager 4.x scenario with VM running SUSE Linux Enterprise Server 15 SP1 or SP2 ### SUSE hints -In order to run tests against SUSE Linux Enterprise Server 15 SP1 / SUSE Manager 4.x you will either require a valid subscription or a trial license. +In order to run tests against SUSE Manager 4.x you will either require a valid subscription or a trial license. You can request a [60-day trial on the SUSE website.](https://www.suse.com/products/suse-manager/download/) For this, you will need to create a [SUSE Customer Center](https://scc.suse.com) account - you will **not** be able to request an additional trial for the same release after the 60 days have expired. @@ -61,6 +61,8 @@ In order to create the test environment execute the following command: $ molecule create ``` +**Double-check** the VM settings! Sometimes Molecule doesn't change the CPU count and memory size. The result is a crashing installation. + Run the Ansible role: ```shell diff --git a/tasks/check_sles.yml b/tasks/check_sles.yml index bc10e35..15bd241 100644 --- a/tasks/check_sles.yml +++ b/tasks/check_sles.yml @@ -2,11 +2,11 @@ - name: Ensure having supported SP release for SUMA 4.0 fail: msg="Please upgrade to SP1" when: - - "{{ suma_release }} == '4.0'" - - "ansible_distribution_version != '15.1'" + - suma_release == 4.0 + - ansible_distribution_version != '15.1' - name: Ensure having supported SP release for SUMA 4.1 - fail: msg="Please upgrade to SP1" + fail: msg="Please upgrade to SP2" when: - - "{{ suma_release }} == '4.1'" - - "ansible_distribution_version != '15.2'" + - suma_release == 4.1 + - ansible_distribution_version != '15.2' diff --git a/tasks/prepare_sles.yml b/tasks/prepare_sles.yml index b57e304..1078659 100644 --- a/tasks/prepare_sles.yml +++ b/tasks/prepare_sles.yml @@ -6,8 +6,21 @@ when: scc_check_registration or scc_check_modules become: true +- name: Prepare JeOS + block: + - name: Remove SLES release + command: 'rpm -e --nodeps sles-release' + args: + removes: /etc/products.d/SLES.prod + - name: Alter zypp configuration + lineinfile: + path: /etc/zypp/zypp.conf + regexp: '^solver.onlyRequires' + line: 'solver.onlyRequires = false' + become: true + - name: Register system - command: "SUSEConnect -r {{ scc_reg_code }} -e {{ scc_mail }}" + command: "SUSEConnect -p SUSE-Manager-Server/{{ suma_release }}/x86_64 -r {{ scc_reg_code }} -e {{ scc_mail }}" when: - scc_check_registration - 'scc_registration.stdout | from_json | json_query(query_filter) | join | lower != "registered"' From da71efe8492d3b50add6520dfe2648ef3c04f35b Mon Sep 17 00:00:00 2001 From: Christian Stankowic Date: Wed, 23 Sep 2020 18:15:45 +0200 Subject: [PATCH 13/15] add missing SLE modules for CEFS (see issue #12) --- defaults/main.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 87a29fd..55c886a 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -12,17 +12,23 @@ uyuni_packages: suma_release: 4.1 scc_check_registration: true scc_check_modules: true +# The 'Desktop Applications' and 'Development Tools' +# modules are required for CEFS/DEFS! sles_modules: - name: sle-module-basesystem identifier: "sle-module-basesystem/{{ ansible_distribution_version }}/x86_64" - name: sle-module-python2 identifier: "sle-module-python2/{{ ansible_distribution_version }}/x86_64" + - name: sle-module-server-applications + identifier: "sle-module-server-applications/{{ ansible_distribution_version }}/x86_64" - name: sle-module-web-scripting identifier: "sle-module-web-scripting/{{ ansible_distribution_version }}/x86_64" + - name: sle-module-desktop-applications + identifier: "sle-module-desktop-applications/{{ ansible_distribution_version }}/x86_64" + - name: sle-module-development-tools + identifier: "sle-module-development-tools/{{ ansible_distribution_version }}/x86_64" - name: sle-module-suse-manager-server identifier: "sle-module-suse-manager-server/{{ suma_release }}/x86_64" - - name: sle-module-server-applications - identifier: "sle-module-server-applications/{{ ansible_distribution_version }}/x86_64" # storage configuration use_lvm: true From 5897ec2aac3b6b9fc233f127e3dd02103d43fd35 Mon Sep 17 00:00:00 2001 From: Christian Stankowic Date: Wed, 23 Sep 2020 18:37:36 +0200 Subject: [PATCH 14/15] ignore command linting error as there is no other solution --- .ansible-lint | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .ansible-lint diff --git a/.ansible-lint b/.ansible-lint new file mode 100644 index 0000000..e4ec007 --- /dev/null +++ b/.ansible-lint @@ -0,0 +1,2 @@ +skip_list: + - '303' From 3caf6c527897d9b7555e37522aac8a92e144265c Mon Sep 17 00:00:00 2001 From: Christian Stankowic Date: Wed, 23 Sep 2020 18:47:46 +0200 Subject: [PATCH 15/15] remove update installation as it's bad style --- README.md | 2 ++ meta/main.yml | 2 +- molecule/README.md | 9 +++++++++ tasks/prepare.yml | 6 ------ 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 2c9edb9..00e0f31 100644 --- a/README.md +++ b/README.md @@ -108,6 +108,8 @@ Don't forget setting SUSE-related variables when deploying SUSE Manager: scc_mail: bla@foo.bar ``` +Ensure having all available system updates installed **before** running the playbook! + ## Common issues Error when running the playbook: diff --git a/meta/main.yml b/meta/main.yml index fc65bd9..20c79c5 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -11,7 +11,7 @@ galaxy_info: platforms: - name: opensuse versions: - - 15.1 + - 15.2 - name: sles versions: - 15 diff --git a/molecule/README.md b/molecule/README.md index 6d5da0e..fc3b3ad 100644 --- a/molecule/README.md +++ b/molecule/README.md @@ -63,6 +63,15 @@ $ molecule create **Double-check** the VM settings! Sometimes Molecule doesn't change the CPU count and memory size. The result is a crashing installation. +Also ensure that all available updates have been installed + +```shell +$ molecule login --host opensuse-leap15 +$ sudo zypper update -y ; exit +$ molecule login --host suma4 +$ sudo zypper update -y ; exit +``` + Run the Ansible role: ```shell diff --git a/tasks/prepare.yml b/tasks/prepare.yml index 1036ca4..5daf12f 100644 --- a/tasks/prepare.yml +++ b/tasks/prepare.yml @@ -1,10 +1,4 @@ --- -- name: Update system # noqa: 403 - zypper: - name: "*" - state: latest - become: true - - name: Install core utilities zypper: name: "{{ core_packages }}"