Changeset - bb8003ddf790
[Not reviewed]
0 9 0
Branko Majic (branko) - 4 years ago 2020-10-01 22:35:46
branko@majic.rs
MAR-155: Make the ansible_key parameter in the preseed role mandatory:

- Updated the preseed role.
- Removed default value for the parameter.
- Updated tests.
- Updated role reference documentation.
- Updated release notes.
9 files changed with 10 insertions and 8 deletions:
0 comments (0 inline, 0 general)
docs/releasenotes.rst
Show inline comments
 
@@ -49,6 +49,8 @@ Breaking changes:
 

	
 
* ``preseed`` role
 

	
 
  * Parameter ``ansible_key`` is now mandatory.
 

	
 
  * Parameter ``preseed_directory`` is now mandatory.
 

	
 
* ``web_server`` role
docs/rolereference.rst
Show inline comments
 
@@ -41,7 +41,7 @@ preseed file per server.
 
Parameters
 
~~~~~~~~~~
 

	
 
**ansible_key** (string, optional, ``{{ lookup('file', '~/.ssh/id_rsa.pub') }}``)
 
**ansible_key** (string, mandatory)
 
  SSH public key that should be deployed to authorized_keys truststore for
 
  operating system user ``root``. This is necessary for the bootstrap process
 
  to work since Debian does not allow password-based logins for root.
roles/preseed/defaults/main.yml
Show inline comments
 
---
 

	
 
ansible_key: "{{ lookup('file', '~/.ssh/id_rsa.pub') }}"
 
preseed_country: SE
 
preseed_keymap: us
 
preseed_language: en
roles/preseed/molecule/default/group_vars/parameters-mandatory.yml
Show inline comments
 
---
 

	
 
ansible_key: MY_ANSIBLE_KEY
 
preseed_directory: "/tmp/preseed_files/"
roles/preseed/molecule/default/group_vars/parameters-optional-with-overrides.yml
Show inline comments
 
---
 

	
 
ansible_key: CUSTOMKEY
 
ansible_key: MY_ANSIBLE_KEY
 
preseed_directory: "/tmp/preseed_files/"
 
preseed_server_overrides:
 
  parameters-optional-with-overrides-stretch64:
roles/preseed/molecule/default/group_vars/parameters-optional.yml
Show inline comments
 
---
 

	
 
ansible_key: CUSTOMKEY
 
ansible_key: MY_ANSIBLE_KEY
 
preseed_country: RS
 
preseed_directory: "/tmp/preseed_files/"
 
preseed_dns: 1.1.1.1
roles/preseed/molecule/default/tests/test_parameters_mandatory.py
Show inline comments
 
@@ -50,7 +50,7 @@ def test_preseed_configuration_file_content(host):
 
        preseed_directory_path = "/tmp/preseed_files"
 
        preseed_file = host.file(os.path.join(preseed_directory_path, "%s.cfg" % hostname))
 
        preseed_file_content = preseed_file.content_string
 
        ssh_public_key = open(os.path.join(os.path.expanduser("~"), ".ssh", "id_rsa.pub")).read().strip()
 
        ssh_public_key = "MY_ANSIBLE_KEY"
 

	
 
    assert "d-i debian-installer/language string en" in preseed_file_content
 
    assert "d-i debian-installer/country string SE" in preseed_file_content
roles/preseed/molecule/default/tests/test_parameters_optional.py
Show inline comments
 
@@ -49,7 +49,7 @@ def test_preseed_configuration_file_content(host):
 
    with host.sudo():
 
        preseed_file = host.file(os.path.join(PRESEED_DIRECTORY, "%s.cfg" % hostname))
 
        preseed_file_content = preseed_file.content_string
 
        ssh_public_key = "CUSTOMKEY"
 
        ssh_public_key = "MY_ANSIBLE_KEY"
 

	
 
    assert "d-i debian-installer/language string sr" in preseed_file_content
 
    assert "d-i debian-installer/country string RS" in preseed_file_content
roles/preseed/molecule/default/tests/test_parameters_optional_with_overrides.py
Show inline comments
 
@@ -33,7 +33,7 @@ def test_preseed_configuration_file_content_host_without_overrides(host):
 
    with host.sudo():
 
        preseed_file = host.file(os.path.join(PRESEED_DIRECTORY, "%s.cfg" % hostname))
 
        preseed_file_content = preseed_file.content_string
 
        ssh_public_key = "CUSTOMKEY"
 
        ssh_public_key = "MY_ANSIBLE_KEY"
 

	
 
    assert "d-i debian-installer/language string en" in preseed_file_content
 
    assert "d-i debian-installer/country string SE" in preseed_file_content
 
@@ -65,7 +65,7 @@ def test_preseed_configuration_file_content_host_with_overrides(host):
 
    with host.sudo():
 
        preseed_file = host.file(os.path.join(PRESEED_DIRECTORY, "%s.cfg" % hostname))
 
        preseed_file_content = preseed_file.content_string
 
        ssh_public_key = "CUSTOMKEY"
 
        ssh_public_key = "MY_ANSIBLE_KEY"
 

	
 
    assert "d-i debian-installer/language string sr" in preseed_file_content
 
    assert "d-i debian-installer/country string RS" in preseed_file_content
0 comments (0 inline, 0 general)