Skip to content

Running debops run wordpress without -l option causes swapfile error #2

@Kairixir

Description

@Kairixir

Task TASK [debops.debops.swapfile : Enable swap files] fails for the second domain in order.

I believe it has to do something with mutex due to extended log when -vvvv option is used. I believe it is because DebOps swapfile role does not expect to run two hosts on a single server.

I won't post the full log, since I have not scanned it for sensitive information. Won't do it now. To see the issue use commit 95c345f3f36bf9947cc7e7cda604c86ba4e0ed15, setup the environment, and run debops run wordpress --tags role::swapfile -vvvv. Temp fix is to run one host after another using -l option.

Minimal example could be to run two hosts on a single server with swapfile role. Have not tested.

Log:

failed: [example.domain.com] (item={'changed': False, 'stdout': 'skipped, since /swapfile exists', 'stderr': '', 'rc': 0, 'cmd': ['fallocate', '-l', '536870912', '/swapfile'], 'start': None, 'end': None, 'delta': None, 'msg': "Did not run command since '/swapfile' exists", 'invocation': {'module_args': {'creates': '/swapfile', '_raw_params': 'fallocate -l 536870912 /swapfile\n', '_uses_shell': False, 'expand_argument_vars': True, 'stdin_add_newline': True, 'strip_empty_ends': True, 'argv': None, 'chdir': None, 'executable': None, 'removes': None, 'stdin': None}}, 'stdout_lines': ['skipped, since /swapfile exists'], 'stderr_lines': [], 'failed': False, 'item': '/swapfile', 'ansible_loop_var': 'item'}) => changed=true
  ansible_loop_var: item
  cmd:
  - swapon
  - -p
  - '-1'
  - /swapfile
  delta: '0:00:00.006262'
  end: '2024-08-27 11:22:47.262825'
  invocation:
    module_args:
      _raw_params: swapon -p -1 /swapfile
      _uses_shell: false
      argv: null
      chdir: null
      creates: null
      executable: null
      expand_argument_vars: true
      removes: null
      stdin: null
      stdin_add_newline: true
      strip_empty_ends: true
  item:
    ansible_loop_var: item
    changed: false
    cmd:
    - fallocate
    - -l
    - '536870912'
    - /swapfile
    delta: null
    end: null
    failed: false
    invocation:
      module_args:
        _raw_params: |-
          fallocate -l 536870912 /swapfile
        _uses_shell: false
        argv: null
        chdir: null
        creates: /swapfile
        executable: null
        expand_argument_vars: true
        removes: null
        stdin: null
        stdin_add_newline: true
        strip_empty_ends: true
    item: /swapfile
    msg: Did not run command since '/swapfile' exists
    rc: 0
    start: null
    stderr: ''
    stderr_lines: []
    stdout: skipped, since /swapfile exists
    stdout_lines:
    - skipped, since /swapfile exists
  msg: non-zero return code
  rc: 255
  start: '2024-08-27 11:22:47.256563'
  stderr: 'swapon: /swapfile: swapon failed: Device or resource busy'
  stderr_lines: <omitted>
  stdout: ''
  stdout_lines: <omitted>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions