1. 11 Nov, 2020 3 commits
  2. 10 Nov, 2020 5 commits
    • Pilou's avatar
    • Pilou's avatar
      Pass the 'inventory' parameter to Ansible/Playbook · 14d822b1
      Pilou authored
      14d822b1
    • Pilou's avatar
      Remove Ansible.set_inventories method · 3353cda9
      Pilou authored
      This method was used only by the unit tests.
      3353cda9
    • Loïc Dachary's avatar
      Merge branch 'cloud-init_avoid_to_restart_SSH_service' into 'master' · 2c2f3f44
      Loïc Dachary authored
      Avoid timeout from SSH client: don't restart SSH service
      
      See merge request main/infrastructure!341
      2c2f3f44
    • Pilou's avatar
      avoid to restart SSH service at boot · d140fa0d
      Pilou authored
      - use reload instead of restart
      - reload service as soon as possible
      - reload only when the default SSH port isn't used
      
      Workaround 'Connection timed out' from SSH client. These timeouts occur
      while SSH service is restarted:
      
          # journalctl -o short-precise -u sshd
          18:22:57.447216 copy-to-host systemd[1]: Started OpenBSD Secure Shell server.
          18:22:57.878128 copy-to-host sshd[601]: Did not receive identification string from 82.123.240.182
          18:23:20.370278 copy-to-host sshd[580]: Received signal 15; terminating.
          18:23:20.371926 copy-to-host systemd[1]: Stopping OpenBSD Secure Shell server...
          18:23:20.373162 copy-to-host systemd[1]: Stopped OpenBSD Secure Shell server.
          18:23:20.375161 copy-to-host systemd[1]: Starting OpenBSD Secure Shell server...
          18:23:20.392807 copy-to-host sshd[885]: Server listening on :: port 22.
          18:23:20.393059 copy-to-host systemd[1]: Started OpenBSD Secure Shell server.
      
          # journalctl -o short-precise -u cloud-final.service
          18:22:58.139066 copy-to-host systemd[1]: Starting Execute cloud user/final scripts...
          18:22:58.724808 copy-to-host cloud-init[606]: Provision began: 2020-11-09 18:22:58.724631
          [...]
          18:23:20.502234 copy-to-host cloud-init[606]: Cloud-init v. 20.2 running 'modules:final' at Mon, 09 Nov 2020 18:22:58 +0000. Up 14.85 seconds.
          18:23:20.502234 copy-to-host cloud-init[606]: Cloud-init v. 20.2 finished at Mon, 09 Nov 2020 18:23:20 +0000. Datasource DataSourceOpenStackLocal [net,ver=2].  Up 36.
          Nov 09 18:23:20.544560 copy-to-host systemd[1]: Started Execute cloud user/final scripts.
      d140fa0d
  3. 09 Nov, 2020 4 commits
  4. 08 Nov, 2020 1 commit
  5. 07 Nov, 2020 3 commits
    • Pilou's avatar
      Remove extraneous line · ea6593ee
      Pilou authored
      Fix "'dict' object has no attribute 'strip'" exception which has been
      introduced by 252ce4e0.
      ea6593ee
    • Loïc Dachary's avatar
      Merge branch 'fix_cleaning_of_test_openstack_create_or_update' into 'master' · 90b19c12
      Loïc Dachary authored
      Destroy ressources created by test_openstack_create_or_update
      
      See merge request main/infrastructure!337
      90b19c12
    • Pilou's avatar
      Destroy ressources created by test_openstack_create_or_update · 1387cbc4
      Pilou authored
      Call o.destroy_everything(None) instead of using openstack_name fixture.
      
      'openstack_name' fixture can not be used to destroy the created
      ressources. Indeed the prefix can not be reused (there is no way to
      use the prefix with ServiceOpenStack.create_or_update).
      
      This issue was encountered while using the following command:
      
          $ tests/run-tests.sh tox -e py3 -- -k "test_openstack_create_or_update or test_clone_and_destroy" tests/enough/
          [...]
          tests/enough/common/test_common_service.py::test_openstack_create_or_update PASSED
          tests/enough/common/test_init.py::test_clone_and_destroy FAILED
      
          =================================== FAILURES ===================================
          ____________________________ test_clone_and_destroy ____________________________
      
          @pytest.mark.skipif('SKIP_OPENSTACK_INTEGRATION_TESTS' in os.environ,
                              reason='skip integration test')
          def test_clone_and_destroy(tmpdir):
      	[...]
              original = Enough(original_config_dir, settings.SHARE_DIR,
                                domain=original_domain,
                                driver='openstack')
          >   assert original.openstack.o.server.list().strip() == ''
          E   AssertionError: assert '+-----------...---+--------+' == ''
          E     - +-----------+--------+---------------------+-----------+--------+
          E     - | Name      | Status | Networks            | Image     | Flavor |
          E     - +-----------+--------+---------------------+-----------+--------+
          E     - | bind-host | ACTIVE | Ext-Net=51.68.95.206| Debian 10 | s1-2   |
          E     - +-----------+--------+---------------------+-----------+--------+
      
          tests/enough/common/test_init.py:38: AssertionError
      1387cbc4
  6. 06 Nov, 2020 2 commits
  7. 05 Nov, 2020 7 commits
    • Pilou's avatar
      Merge branch 'ansible_deduplicate_bake' into 'master' · 3429a713
      Pilou authored
      ansible_utils: use only one bake method
      
      See merge request main/infrastructure!332
      3429a713
    • Loïc Dachary's avatar
      Merge branch 'use_unchanged_json_format_instead_of_value' into 'master' · 58f0512e
      Loïc Dachary authored
      use unchanged 'json' format instead of 'value'
      
      See merge request main/infrastructure!335
      58f0512e
    • Pilou's avatar
      use unchanged 'json' format instead of 'value' · a675e27e
      Pilou authored
      Fix this issue:
      
          $ tests/run-tests.sh tox -e py3 -- -k test_create_missings tests/enough/common/test_init.py
          [...]
          Traceback (most recent call last):
            File "/srv/share/src/ansible/enough.community/infrastructure.git/tests/enough/common/test_init.py", line 290, in test_create_missings
      	assert bind_internal_ip == internal_dns
          AssertionError: assert '10.30.20.120' == "['10.30.20.120']"
            - 10.30.20.120
            + ['10.30.20.120']
            ? ++            ++
      
          During handling of the above exception, another exception occurred:
      
          Traceback (most recent call last):
            File "/srv/share/src/ansible/enough.community/infrastructure.git/enough/common/retry.py", line 19, in f_retry
      	return f(*args, **kwargs)
            File "/srv/share/src/ansible/enough.community/infrastructure.git/enough/common/openstack.py", line 399, in destroy_everything
      	raise OpenStackLeftovers('scheduled removal of ' + ' '.join(leftovers))
          enough.common.openstack.OpenStackLeftovers: scheduled removal of stack(bind-host) network(internal)
          openstack.py               341 INFO     destroy_everything acting
          openstack.py                34 INFO     []
      a675e27e
    • Loïc Dachary's avatar
      Merge branch 'destroy_volumes_snapshots_by_id' into 'master' · f28dace1
      Loïc Dachary authored
      Destroy volumes and snapshots using ID instead of Name
      
      See merge request main/infrastructure!334
      f28dace1
    • Pilou's avatar
      delete volumes and snapshots using ID · 252ce4e0
      Pilou authored
      names might not be unique.
      
      Fix this issue:
      
          sh.py        628 INFO <Command 'py3/bin/openstack --os-cloud production volume list --format=value -c Name'>: starting process
          sh.py        628 INFO <Command 'py3/bin/openstack --os-cloud production volume list --format=value -c Name', pid 120>: process started
          openstack.py  34 INFO enough_test_1604579181
          openstack.py  34 INFO enough_test_1604579181
          sh.py        628 INFO <Command 'py3/bin/openstack --os-cloud production volume delete enough_test_1604579181'>: starting process
          sh.py        628 INFO <Command 'py3/bin/openstack --os-cloud production volume delete enough_test_1604579181', pid 124>: process started
          openstack.py  35 INFO Failed to delete volume with name or ID 'enough_test_1604579181-test-destroy-volume':
      			  More than one volume exists with the name 'enough_test_1604579181-test-destroy-volume'.
          openstack.py  35 INFO 1 of 1 volumes failed to delete.
      252ce4e0
    • Loïc Dachary's avatar
      Merge branch 'fix_regression_replace_volume' into 'master' · bc04882b
      Loïc Dachary authored
      Fetch volume id before two volumes of the same name exist
      
      See merge request main/infrastructure!333
      bc04882b
    • Pilou's avatar
      Fetch id before two volumes of the same name exist · d13b56a9
      Pilou authored
      Fix regression introduced by 436b297b:
      
          $ run-tests.sh tox -e py3 -- -s -k test_restore_local tests/enough/common/test_init.py
          [...]
          retry.py                    21 INFO     OpenStack.destroy_everything: scheduled removal of snapshot(2020-11-04-sample-volume) stack(sample-host) volume(2020-11-04-sample-volume) network(internal), Retrying in 1 seconds...
          retry.py                    23 DEBUG
          Traceback (most recent call last):
            File "infrastructure/tests/enough/common/test_init.py", line 267, in test_restore_local
      	assert e == e.restore_local(snapshot)
            File "infrastructure/enough/common/__init__.py", line 249, in restore_local
      	self.openstack.replace_volume(host, volume, delete_volume=False)
            File "infrastructure/enough/common/openstack.py", line 565, in replace_volume
      	volume_id = self.o.volume.show('--format=value', '-c', 'id', volume).stdout.strip()
            File "infrastructure/.tox/py3/lib/python3.7/site-packages/sh.py", line 1427, in __call__
      	return RunningCommand(cmd, call_args, stdin, stdout, stderr)
            File "infrastructure/.tox/py3/lib/python3.7/site-packages/sh.py", line 774, in __init__
      	self.wait()
            File "infrastructure/.tox/py3/lib/python3.7/site-packages/sh.py", line 792, in wait
      	self.handle_command_exit_code(exit_code)
            File "infrastructure/.tox/py3/lib/python3.7/site-packages/sh.py", line 815, in handle_command_exit_code
      	raise exc
          sh.ErrorReturnCode_1:
      
            RAN: infrastructure/.tox/py3/bin/openstack --os-cloud production volume show --format=value -c id 2020-11-04-sample-volume
      d13b56a9
  8. 04 Nov, 2020 1 commit
    • Pilou's avatar
      ansible_utils: use only one bake method · 233a6a49
      Pilou authored
      rationales:
      - Ansible.bake_ansible_playbook & Playbook.bake were both baking
        ansible-playbook command
      - Ansible.bake_ansible_playbook ignores environment variables
        Playbook.bake doesn't (same fix as 24760bb7)
      - Playbook.get_variable_hosts was using inventories twice
      233a6a49
  9. 03 Nov, 2020 4 commits
  10. 23 Oct, 2020 7 commits
  11. 22 Oct, 2020 3 commits