Changeset - db859106bed8
[Not reviewed]
0 1 0
Branko Majic (branko) - 17 days ago 2024-09-02 23:16:51
branko@majic.rs
MAR-218: Document the workaround needed to make Molecule instance logins work:

- It should be possible to drop this workaround once the upstream has
taken care of merging the necessary fixes.
1 file changed with 9 insertions and 8 deletions:
0 comments (0 inline, 0 general)
docs/development.rst
Show inline comments
 
@@ -51,61 +51,62 @@ performing the following steps:
 

	
 
     * 192.168.56.0/21
 
     * fd00::192:168:56:0/116
 

	
 
4. Clone the git repository::
 

	
 
     git clone https://code.majic.rs/majic-ansible-roles/ ~/projects/
 

	
 
5. Create a separate Python virtual environment::
 

	
 
     mkvirtualenv majic-ansible-roles -a ~/projects/majic-ansible-roles/
 

	
 
6. Make sure the virtual environment has been activated, and install `pip-tools
 
   <https://github.com/jazzband/pip-tools>`_::
 

	
 
     workon majic-ansible-roles
 
     pip install pip-tools
 

	
 
7. Synchronise Python virtual environment with requirements file using
 
   **pip-tools**::
 

	
 
     workon majic-ansible-roles
 
     pip-sync
 

	
 
8. Patch the installed version of test runner (Molecule) for
 
   compatibility with newer versions of Vagrant (bundled Ruby):
 
8. Patch the installed version of test runner (Molecule) plugins until
 
   upstream merges the requried fixes for logging-in into Molecule
 
   Vagrant instances:
 

	
 
   .. note::
 
      This is an unfortunate consequence of *Majic Ansible Roles*
 
      being dependent on an old/deprecated version of Ansible. This
 
      will be addressed at some point in the future when the roles are
 
      moved over to being compatible with latest (and supported)
 
      versions of Ansible.
 
      For more details, see the following project links:
 

	
 
      - https://github.com/ansible-community/molecule-plugins/issues/239
 
      - https://github.com/ansible-community/molecule-plugins/pull/240
 
      - https://github.com/ansible-community/molecule-plugins/pull/260
 

	
 
   ::
 

	
 
      sed -i -e 's/ Hash\[/ **Hash[/' ~/.virtualenvs/majic-ansible-roles/lib/python3.9/site-packages/molecule/provisioner/ansible/plugins/libraries/molecule_vagrant.py
 
      sed -i -e 's/{{/{/g;s/}}/}/g' "$VIRTUAL_ENV/lib/python3."*"/site-packages/molecule_plugins/vagrant/driver.py"
 

	
 

	
 
Development conventions
 
-----------------------
 

	
 
In order to maintain consistency across different roles and documentation, this
 
section describes development conventions that should be followed while making
 
modifications.
 

	
 

	
 
Task specifications
 
~~~~~~~~~~~~~~~~~~~
 

	
 
When writing new and updating existing tasks, keep the following in mind:
 

	
 
- Quote sensibly. If specifying paths (for example ``src``, ``dest``, ``path``
 
  etc in various models), quote the string to make it stand-out better and to
 
  avoid breakages.
 
- Avoid usage of ``set_facts`` task when same functionality can be achieved via
 
  ``defaults/main.yml``.
 
- When specifying tasks, use the fully expanded form. Do not use single-line
 
  form with ``param=value``.
 
- When specifying ``command`` or ``shell`` tasks, in case a ``creates``
 
  parameter or such need to be used, specify them as part of task's ``args``
0 comments (0 inline, 0 general)