ansible-role-rust icon indicating copy to clipboard operation
ansible-role-rust copied to clipboard

Condition error

Open im-n1 opened this issue 6 years ago • 10 comments

When I run your role with:

  roles:
    - role: fubarhouse.rust
      vars:
        rust_version: 1.37
        shell_profiles:
          - .zprofile
        cargo_items:
          - bat
          - lsd
          - pug
          - racer
          - rustfmt-nighty
          - sass-rs
          - spruce
      become: true

I get (screenshot taken from virtual, sorry): image

im-n1 avatar Sep 06 '19 05:09 im-n1

Thanks for reporting! It seems the logic needs to be updated - I'll make it happen.

fubarhouse avatar Sep 06 '19 10:09 fubarhouse

Changes introduced in branch issue/20 will fix this issue. You will however need to change rust_version to 1.37.0.

Please test when possible.

meta:
  timestamp: 2019-09-08T22:10:05.607375+10:00
  repository: [email protected]:fubarhouse/ansible-role-rust.git
  commithash: 104550badc276ddef02d83c796c4d38882e89055
  localchanges: true
  reportfile: report.yml
ansible:
  config:
    hostpath: /Users/karl/PycharmProjects/ansible-role-rust
    inventory: ""
    remotepath: /etc/ansible/roles/role_under_test
    extrarolespath: ""
    librarypath: ""
    requirementsfile: ""
    playbookfile: tests/playbook.yml
    remote: false
    verbose: true
    quiet: false
  distribution:
    cid: ""
    name: ubuntu1804
    privileged: true
    container: fubarhouse/docker-ansible:bionic
    user: fubarhouse
    distro: ubuntu1804
    family:
      name: Ubuntu
      initialise: /sbin/init
      volume: /sys/fs/cgroup:/sys/fs/cgroup:ro
  hosts:
  - localhost
  syntax: true
  requirements: false
  run:
    result: true
    time: 3m53.524527879s
  idempotence:
    result: true
    time: 10.799883279s
docker:
  run: true
  kill: true
  volumes:
  - /sys/fs/cgroup:/sys/fs/cgroup:ro
  - /Users/karl/PycharmProjects/ansible-role-rust:/etc/ansible/roles/role_under_test
  - /Users/karl/PycharmProjects/ansible-role-rust:/etc/ansible/roles/ansible-role-rust

fubarhouse avatar Sep 08 '19 12:09 fubarhouse

Note that I will fix up the automated testing in the meantime.

fubarhouse avatar Sep 08 '19 12:09 fubarhouse

I dont have any machine available for tests right now.

im-n1 avatar Sep 08 '19 19:09 im-n1

Seeing as this fixes just one piece of logic which doesn't fail with a valid version identifier of Rust, I'll merge this tonight. It seems I need to update my tester, so this can come independently of this change.

fubarhouse avatar Sep 09 '19 00:09 fubarhouse

I did test it with 1.37 and it failed. I guess if your instalation goes well it's ok.

im-n1 avatar Sep 09 '19 04:09 im-n1

Have you tried using 1.37.0 and not 1.37?

fubarhouse avatar Sep 09 '19 04:09 fubarhouse

yes

im-n1 avatar Sep 09 '19 04:09 im-n1

Are you able to provide a verbose output of the problem? I thought I had successfully replicated and resolved the issue you were facing - I may have been mistaken.

fubarhouse avatar Sep 09 '19 10:09 fubarhouse

I got the same error. Here's the output, tested on Ubuntu 18.04 fresh box:

TASK [rust : Rust | Install Cargo] ********************************************************************************************************
ok: [HIDDEN.IP.ADDRESS.HERE] => (item={'name': 'ripgrep', 'binary': 'rg'})

TASK [rust : Rust | Verify Cargo] *********************************************************************************************************
failed: [HIDDEN.IP.ADDRESS.HERE] (item={'changed': False, 'end': '2020-07-01 16:55:17.367578', 'stdout': '', 'cmd': '/root/.cargo/bin/cargo install ripgrep | cat', 'rc': 0, 'start': '2020-07-01 16:55:16.252156', 'stderr': '    Updating crates.io index\n     Ignored package `ripgrep v12.1.1` is already installed, use --force to override', 'delta': '0:00:01.115422', 'invocation': {'module_args': {'creates': None, 'executable': None, '_uses_shell': True, 'strip_empty_ends': True, '_raw_params': '/root/.cargo/bin/cargo install ripgrep | cat', 'removes': None, 'argv': None, 'warn': True, 'chdir': None, 'stdin_add_newline': True, 'stdin': None}}, 'stdout_lines': [], 'stderr_lines': ['    Updating crates.io index', '     Ignored package `ripgrep v12.1.1` is already installed, use --force to override'], 'failed': False, 'item': {'name': 'ripgrep', 'binary': 'rg'}, 'ansible_loop_var': 'item'}) => {"ansible_loop_var": "item", "changed": false, "cmd": "/root/.cargo/bin/cargo", "delta": "0:00:00.009836", "end": "2020-07-01 16:55:18.377396", "failed_when_result": true, "item": {"ansible_loop_var": "item", "changed": false, "cmd": "/root/.cargo/bin/cargo install ripgrep | cat", "delta": "0:00:01.115422", "end": "2020-07-01 16:55:17.367578", "failed": false, "invocation": {"module_args": {"_raw_params": "/root/.cargo/bin/cargo install ripgrep | cat", "_uses_shell": true, "argv": null, "chdir": null, "creates": null, "executable": null, "removes": null, "stdin": null, "stdin_add_newline": true, "strip_empty_ends": true, "warn": true}}, "item": {"binary": "rg", "name": "ripgrep"}, "rc": 0, "start": "2020-07-01 16:55:16.252156", "stderr": "    Updating crates.io index\n     Ignored package `ripgrep v12.1.1` is already installed, use --force to override", "stderr_lines": ["    Updating crates.io index", "     Ignored package `ripgrep v12.1.1` is already installed, use --force to override"], "stdout": "", "stdout_lines": []}, "rc": 0, "start": "2020-07-01 16:55:18.367560", "stderr": "", "stderr_lines": [], "stdout": "Rust's package manager\n\nUSAGE:\n    cargo [OPTIONS] [SUBCOMMAND]\n\nOPTIONS:\n    -V, --version           Print version info and exit\n        --list              List installed commands\n        --explain <CODE>    Run `rustc --explain CODE`\n    -v, --verbose           Use verbose output (-vv very verbose/build.rs output)\n    -q, --quiet             No output printed to stdout\n        --color <WHEN>      Coloring: auto, always, never\n        --frozen            Require Cargo.lock and cache are up to date\n        --locked            Require Cargo.lock is up to date\n        --offline           Run without accessing the network\n    -Z <FLAG>...            Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details\n    -h, --help              Prints help information\n\nSome common cargo commands are (see all commands with --list):\n    build       Compile the current package\n    check       Analyze the current package and report errors, but don't build object files\n    clean       Remove the target directory\n    doc         Build this package's and its dependencies' documentation\n    new         Create a new cargo package\n    init        Create a new cargo package in an existing directory\n    run         Run a binary or example of the local package\n    test        Run the tests\n    bench       Run the benchmarks\n    update      Update dependencies listed in Cargo.lock\n    search      Search registry for crates\n    publish     Package and upload this package to the registry\n    install     Install a Rust binary. Default location is $HOME/.cargo/bin\n    uninstall   Uninstall a Rust binary\n\nSee 'cargo help <command>' for more information on a specific command.", "stdout_lines": ["Rust's package manager", "", "USAGE:", "    cargo [OPTIONS] [SUBCOMMAND]", "", "OPTIONS:", "    -V, --version           Print version info and exit", "        --list              List installed commands", "        --explain <CODE>    Run `rustc --explain CODE`", "    -v, --verbose           Use verbose output (-vv very verbose/build.rs output)", "    -q, --quiet             No output printed to stdout", "        --color <WHEN>      Coloring: auto, always, never", "        --frozen            Require Cargo.lock and cache are up to date", "        --locked            Require Cargo.lock is up to date", "        --offline           Run without accessing the network", "    -Z <FLAG>...            Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details", "    -h, --help              Prints help information", "", "Some common cargo commands are (see all commands with --list):", "    build       Compile the current package", "    check       Analyze the current package and report errors, but don't build object files", "    clean       Remove the target directory", "    doc         Build this package's and its dependencies' documentation", "    new         Create a new cargo package", "    init        Create a new cargo package in an existing directory", "    run         Run a binary or example of the local package", "    test        Run the tests", "    bench       Run the benchmarks", "    update      Update dependencies listed in Cargo.lock", "    search      Search registry for crates", "    publish     Package and upload this package to the registry", "    install     Install a Rust binary. Default location is $HOME/.cargo/bin", "    uninstall   Uninstall a Rust binary", "", "See 'cargo help <command>' for more information on a specific command."]}

PLAY RECAP ********************************************************************************************************************************
HIDDEN.IP.ADDRESS.HERE              : ok=41   changed=0    unreachable=0    failed=1    skipped=19   rescued=0    ignored=0

niftylettuce avatar Jul 01 '20 22:07 niftylettuce