geerlingguy / drupal-vm

A VM for Drupal development
https://www.drupalvm.com/
MIT License
1.37k stars 646 forks source link

I cannot initialize a new vm with ansible installed via git as normal user (with root it works). #1725

Closed dlopez-akalam closed 6 years ago

dlopez-akalam commented 6 years ago

Issue Type

Your Environment

Vagrant 2.0.2
VirtualBox 5.1.30_Ubuntur118389
ansible 2.4.4 (stable-2.4 92cea82a4e) last updated 2018/02/28 20:16:43 (GMT +200)
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/home/david/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /opt/ansible/lib/ansible
  executable location = /opt/ansible/bin/ansible
  python version = 2.7.14 (default, Sep 23 2017, 22:06:14) [GCC 7.2.0]

Your OS

Full console output

vagrant up --debug
 INFO global: Vagrant version: 1.9.8
 INFO global: Ruby version: 2.3.4
 INFO global: RubyGems version: 2.5.2
 INFO global: VAGRANT_OLD_ENV_XDG_SESSION_DESKTOP="KDE"
 INFO global: VAGRANT_OLD_ENV_SHELL="/bin/bash"
 INFO global: VAGRANT_OLD_ENV_WINDOWID="83886086"
 INFO global: VAGRANT_OLD_ENV_PATH="/opt/ansible/bin:/opt/ansible/test/runner:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"
 INFO global: VAGRANT_OLD_ENV_LC_TIME="es_ES.UTF-8"
 INFO global: VAGRANT_EXECUTABLE="/opt/vagrant/embedded/gems/gems/vagrant-1.9.8/bin/vagrant"
 INFO global: VAGRANT_OLD_ENV_DISPLAY=":0"
 INFO global: VAGRANT_OLD_ENV_LC_ADDRESS="es_ES.UTF-8"
 INFO global: VAGRANT_OLD_ENV_SESSION_MANAGER="local/bree:@/tmp/.ICE-unix/1794,unix/bree:/tmp/.ICE-unix/1794"
 INFO global: VAGRANT_OLD_ENV_OLDPWD="/home/david/vagrant/blt-test/blt"
 INFO global: VAGRANT_OLD_ENV_MANPATH="/opt/ansible/docs/man:"
 INFO global: VAGRANT_OLD_ENV_LC_IDENTIFICATION="es_ES.UTF-8"
 INFO global: VAGRANT_OLD_ENV_MANDATORY_PATH="/usr/share/gconf//usr/share/xsessions/plasma.mandatory.path"
 INFO global: VAGRANT_OLD_ENV_USER="david"
 INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="/opt/vagrant/embedded"
 INFO global: VAGRANT_OLD_ENV_LANG="en_US.UTF-8"
 INFO global: VAGRANT_OLD_ENV_SSH_AUTH_SOCK="/tmp/ssh-sHJL627f3bcu/agent.1660"
 INFO global: VAGRANT_OLD_ENV_DBUS_SESSION_BUS_ADDRESS="unix:abstract=/tmp/dbus-Eyp7JhvAO9,guid=510a69e100b2d57befefb29f5aa0e25f"
 INFO global: VAGRANT_OLD_ENV_QT_QUICK_CONTROLS_STYLE="org.kde.desktop"
 INFO global: VAGRANT_OLD_ENV_KONSOLE_PROFILE_NAME="Profile 1"
 INFO global: VAGRANT_OLD_ENV_LC_MEASUREMENT="es_ES.UTF-8"
 INFO global: VAGRANT_OLD_ENV_LANGUAGE=""
 INFO global: VAGRANT_OLD_ENV_XDG_CONFIG_DIRS="/etc/xdg/xdg-/usr/share/xsessions/plasma:/etc/xdg:/usr/share/kubuntu-default-settings/kf5-settings"
 INFO global: VAGRANT_OLD_ENV_LC_PAPER="es_ES.UTF-8"
 INFO global: VAGRANT_OLD_ENV_ANSIBLE_HOME="/opt/ansible"
 INFO global: VAGRANT_OLD_ENV_PYTHONPATH="/opt/ansible/lib:"
 INFO global: VAGRANT_OLD_ENV_KONSOLE_DBUS_SESSION="/Sessions/9"
 INFO global: VAGRANT_INSTALLER_VERSION="2"
 INFO global: VAGRANT_OLD_ENV_DESKTOP_SESSION="/usr/share/xsessions/plasma"
 INFO global: VAGRANT_OLD_ENV_LC_MONETARY="es_ES.UTF-8"
 INFO global: VAGRANT_OLD_ENV_LC_NUMERIC="es_ES.UTF-8"
 INFO global: VAGRANT_OLD_ENV_XDG_CURRENT_DESKTOP="KDE"
 INFO global: VAGRANT_OLD_ENV_XDG_RUNTIME_DIR="/run/user/1000"
 INFO global: VAGRANT_OLD_ENV_PWD="/home/david/vagrant/blt-test"
 INFO global: VAGRANT_OLD_ENV_XDG_SEAT_PATH="/org/freedesktop/DisplayManager/Seat0"
 INFO global: VAGRANT_OLD_ENV_XDG_DATA_DIRS="/usr/share//usr/share/xsessions/plasma:/usr/local/share:/usr/share:/var/lib/snapd/desktop"
 INFO global: VAGRANT_OLD_ENV_XDG_SESSION_CLASS="user"
 INFO global: VAGRANT_OLD_ENV_XDG_SESSION_PATH="/org/freedesktop/DisplayManager/Session1"
 INFO global: VAGRANT_OLD_ENV_KDE_SESSION_UID="1000"
 INFO global: VAGRANT_OLD_ENV_LS_COLORS="rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:"
 INFO global: VAGRANT_OLD_ENV_LC_NAME="es_ES.UTF-8"
 INFO global: VAGRANT_OLD_ENV_QT_AUTO_SCREEN_SCALE_FACTOR="0"
 INFO global: VAGRANT_OLD_ENV_KDE_FULL_SESSION="true"
 INFO global: VAGRANT_OLD_ENV_SHELL_SESSION_ID="46c76dc985594c05a5f8148117d87df5"
 INFO global: VAGRANT_OLD_ENV_XDG_VTNR="7"
 INFO global: VAGRANT_OLD_ENV__="/opt/vagrant/bin/vagrant"
 INFO global: VAGRANT_OLD_ENV_PROFILEHOME=""
 INFO global: VAGRANT_OLD_ENV_SSH_AGENT_PID="1735"
 INFO global: VAGRANT_OLD_ENV_TERM="xterm-256color"
 INFO global: VAGRANT_OLD_ENV_COLORFGBG="15;0"
 INFO global: VAGRANT_INSTALLER_ENV="1"
 INFO global: VAGRANT_OLD_ENV_GS_LIB="/home/david/.fonts"
 INFO global: VAGRANT_OLD_ENV_DEFAULTS_PATH="/usr/share/gconf//usr/share/xsessions/plasma.default.path"
 INFO global: VAGRANT_OLD_ENV_HOME="/home/david"
 INFO global: VAGRANT_OLD_ENV_XDG_SESSION_TYPE="x11"
 INFO global: VAGRANT_OLD_ENV_KONSOLE_DBUS_WINDOW="/Windows/1"
 INFO global: VAGRANT_OLD_ENV_KONSOLE_DBUS_SERVICE=":1.64"
 INFO global: VAGRANT_OLD_ENV_COLORTERM="truecolor"
 INFO global: VAGRANT_OLD_ENV_PAM_KWALLET5_LOGIN="/run/user/1000/kwallet5.socket"
 INFO global: VAGRANT_OLD_ENV_XAUTHORITY="/home/david/.Xauthority"
 INFO global: VAGRANT_OLD_ENV_SHLVL="2"
 INFO global: VAGRANT_OLD_ENV_XDG_SEAT="seat0"
 INFO global: VAGRANT_OLD_ENV_PAM_KWALLET_LOGIN="/run/user/1000/kwallet.socket"
 INFO global: VAGRANT_OLD_ENV_XCURSOR_THEME="breeze_cursors"
 INFO global: VAGRANT_OLD_ENV_LC_TELEPHONE="es_ES.UTF-8"
 INFO global: VAGRANT_OLD_ENV_KDE_SESSION_VERSION="5"
 INFO global: VAGRANT_OLD_ENV_LOGNAME="david"
 INFO global: VAGRANT_OLD_ENV_XDG_SESSION_ID="4"
 INFO global: VAGRANT_OLD_ENV_QT_ACCESSIBILITY="1"
 INFO global: VAGRANT_LOG="debug"
 INFO global: Plugins:
 INFO global:   - vagrant-hostsupdater = [installed: 1.0.2 constraint: > 0]
 INFO global:   - vagrant-rsync-back = [installed: 0.0.1 constraint: > 0]
 INFO global:   - vagrant-share = [installed: undefined constraint: > 0]
 INFO global:   - vagrant-vbguest = [installed: 0.15.1 constraint: > 0]
DEBUG bundler: Current generated plugin dependency list: [<Gem::Dependency type=:runtime name="vagrant-hostsupdater" requirements="> 0">, <Gem::Dependency type=:runtime name="vagrant-rsync-back" requirements="> 0">, <Gem::Dependency type=:runtime name="vagrant-share" requirements="> 0">, <Gem::Dependency type=:runtime name="vagrant-vbguest" requirements="> 0">]
DEBUG bundler: Generating new builtin set instance.
DEBUG bundler: Generating new plugin set instance. Skip gems - []
DEBUG bundler: Activating solution set: ["vagrant-hostsupdater-1.0.2", "vagrant-rsync-back-0.0.1", "ruby_dep-1.3.1", "erubis-2.7.0", "builder-3.2.3", "gyoku-1.3.1", "nori-2.6.0", "multi_json-1.12.1", "little-plugger-1.1.4", "logging-2.2.2", "rubyntlm-0.6.2", "httpclient-2.8.3", "ffi-1.9.18", "gssapi-1.2.0", "winrm-2.2.3", "rubyzip-1.2.1", "winrm-fs-1.0.1", "winrm-elevated-1.1.0", "wdm-0.1.1", "netrc-0.11.0", "mime-types-data-3.2016.0521", "mime-types-3.1", "unf_ext-0.0.7.4", "unf-0.1.4", "domain_name-0.5.20170404", "http-cookie-1.0.3", "rest-client-2.0.2", "rb-kqueue-0.2.5", "net-ssh-4.1.0", "net-scp-1.2.1", "net-sftp-2.1.2", "log4r-1.1.10", "hashicorp-checkpoint-0.1.4", "rb-inotify-0.9.10", "rb-fsevent-0.10.2", "listen-3.1.5", "i18n-0.8.0", "childprocess-0.6.3", "vagrant-1.9.8", "vagrant-share-1.1.9", "micromachine-2.0.0", "vagrant-vbguest-0.15.1"]
DEBUG bundler: Activating gem vagrant-hostsupdater-1.0.2
DEBUG bundler: Activating gem vagrant-rsync-back-0.0.1
DEBUG bundler: Activating gem vagrant-share-1.1.9
DEBUG bundler: Activating gem micromachine-2.0.0
DEBUG bundler: Activating gem vagrant-vbguest-0.15.1
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/communicators/ssh/plugin.rb
 INFO manager: Registered plugin: ssh communicator
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/communicators/winrm/plugin.rb
 INFO manager: Registered plugin: winrm communicator
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/communicators/winssh/plugin.rb
 INFO manager: Registered plugin: windows ssh communicator
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/hosts/slackware/plugin.rb
 INFO manager: Registered plugin: Slackware host
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/hosts/bsd/plugin.rb
 INFO manager: Registered plugin: BSD host
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/hosts/redhat/plugin.rb
 INFO manager: Registered plugin: Red Hat Enterprise Linux host
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/hosts/suse/plugin.rb
 INFO manager: Registered plugin: SUSE host
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/hosts/windows/plugin.rb
 INFO manager: Registered plugin: Windows host
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/hosts/gentoo/plugin.rb
 INFO manager: Registered plugin: Gentoo host
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/hosts/freebsd/plugin.rb
 INFO manager: Registered plugin: FreeBSD host
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/hosts/arch/plugin.rb
 INFO manager: Registered plugin: Arch host
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/hosts/linux/plugin.rb
 INFO manager: Registered plugin: Linux host
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/hosts/darwin/plugin.rb
 INFO manager: Registered plugin: Mac OS X host
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/hosts/null/plugin.rb
 INFO manager: Registered plugin: null host
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/guests/elementary/plugin.rb
 INFO manager: Registered plugin: Elementary guest
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/guests/mint/plugin.rb
 INFO manager: Registered plugin: Mint guest
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/guests/slackware/plugin.rb
 INFO manager: Registered plugin: Slackware guest
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/guests/solaris11/plugin.rb
 INFO manager: Registered plugin: Solaris 11 guest.
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/guests/debian/plugin.rb
 INFO manager: Registered plugin: Debian guest
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/guests/bsd/plugin.rb
 INFO manager: Registered plugin: BSD-based guest
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/guests/trisquel/plugin.rb
 INFO manager: Registered plugin: Trisquel guest
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/guests/redhat/plugin.rb
 INFO manager: Registered plugin: Red Hat Enterprise Linux guest
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/guests/suse/plugin.rb
 INFO manager: Registered plugin: SUSE guest
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/guests/funtoo/plugin.rb
 INFO manager: Registered plugin: Funtoo guest
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/guests/solaris/plugin.rb
 INFO manager: Registered plugin: Solaris guest.
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/guests/esxi/plugin.rb
 INFO manager: Registered plugin: ESXi guest.
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/guests/windows/plugin.rb
 INFO manager: Registered plugin: Windows guest.
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/guests/kali/plugin.rb
 INFO manager: Registered plugin: Kali guest
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/guests/fedora/plugin.rb
 INFO manager: Registered plugin: Fedora guest
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/guests/openbsd/plugin.rb
 INFO manager: Registered plugin: OpenBSD guest
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/guests/smartos/plugin.rb
 INFO manager: Registered plugin: SmartOS guest.
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/guests/pld/plugin.rb
 INFO manager: Registered plugin: PLD Linux guest
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/guests/gentoo/plugin.rb
 INFO manager: Registered plugin: Gentoo guest
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/guests/freebsd/plugin.rb
 INFO manager: Registered plugin: FreeBSD guest
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/guests/arch/plugin.rb
 INFO manager: Registered plugin: Arch guest
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/guests/linux/plugin.rb
 INFO manager: Registered plugin: Linux guest.
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/guests/dragonflybsd/plugin.rb
 INFO manager: Registered plugin: DragonFly BSD guest
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/guests/darwin/plugin.rb
 INFO manager: Registered plugin: Darwin guest
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/guests/photon/plugin.rb
 INFO manager: Registered plugin: VMware Photon guest
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/guests/tinycore/plugin.rb
 INFO manager: Registered plugin: TinyCore Linux guest.
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/guests/netbsd/plugin.rb
 INFO manager: Registered plugin: NetBSD guest
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/guests/nixos/plugin.rb
 INFO manager: Registered plugin: NixOS guest
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/guests/amazon/plugin.rb
 INFO manager: Registered plugin: Amazon Linux guest
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/guests/atomic/plugin.rb
 INFO manager: Registered plugin: Atomic Host guest
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/guests/coreos/plugin.rb
 INFO manager: Registered plugin: CoreOS guest
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/guests/omnios/plugin.rb
 INFO manager: Registered plugin: OmniOS guest.
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/guests/ubuntu/plugin.rb
 INFO manager: Registered plugin: Ubuntu guest
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/providers/virtualbox/plugin.rb
 INFO manager: Registered plugin: VirtualBox provider
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/providers/docker/plugin.rb
 INFO manager: Registered plugin: docker-provider
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/providers/hyperv/plugin.rb
 INFO manager: Registered plugin: Hyper-V provider
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/pushes/local-exec/plugin.rb
 INFO manager: Registered plugin: local-exec
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/pushes/atlas/plugin.rb
 INFO manager: Registered plugin: atlas
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/pushes/heroku/plugin.rb
 INFO manager: Registered plugin: heroku
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/pushes/ftp/plugin.rb
 INFO manager: Registered plugin: ftp
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/pushes/noop/plugin.rb
 INFO manager: Registered plugin: noop
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/kernel_v1/plugin.rb
 INFO manager: Registered plugin: kernel
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/commands/list-commands/plugin.rb
 INFO manager: Registered plugin: list-commands command
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/commands/port/plugin.rb
 INFO manager: Registered plugin: port command
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/commands/push/plugin.rb
 INFO manager: Registered plugin: push command
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/commands/status/plugin.rb
 INFO manager: Registered plugin: status command
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/commands/resume/plugin.rb
 INFO manager: Registered plugin: resume command
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/commands/halt/plugin.rb
 INFO manager: Registered plugin: halt command
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/commands/suspend/plugin.rb
 INFO manager: Registered plugin: suspend command
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/commands/version/plugin.rb
 INFO manager: Registered plugin: version command
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/commands/provision/plugin.rb
 INFO manager: Registered plugin: provision command
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/commands/powershell/plugin.rb
 INFO manager: Registered plugin: powershell command
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/commands/init/plugin.rb
 INFO manager: Registered plugin: init command
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/commands/box/plugin.rb
 INFO manager: Registered plugin: box command
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/commands/ssh/plugin.rb
 INFO manager: Registered plugin: ssh command
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/commands/reload/plugin.rb
 INFO manager: Registered plugin: reload command
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/commands/rdp/plugin.rb
 INFO manager: Registered plugin: rdp command
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/commands/package/plugin.rb
 INFO manager: Registered plugin: package command
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/commands/snapshot/plugin.rb
 INFO manager: Registered plugin: snapshot command
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/commands/cap/plugin.rb
 INFO manager: Registered plugin: cap command
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/commands/provider/plugin.rb
 INFO manager: Registered plugin: provider command
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/commands/login/plugin.rb
 INFO manager: Registered plugin: vagrant-login
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/commands/ssh_config/plugin.rb
 INFO manager: Registered plugin: ssh-config command
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/commands/global-status/plugin.rb
 INFO manager: Registered plugin: global-status command
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/commands/up/plugin.rb
 INFO manager: Registered plugin: up command
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/commands/help/plugin.rb
 INFO manager: Registered plugin: help command
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/commands/plugin/plugin.rb
 INFO manager: Registered plugin: plugin command
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/commands/destroy/plugin.rb
 INFO manager: Registered plugin: destroy command
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/commands/validate/plugin.rb
 INFO manager: Registered plugin: validate command
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/provisioners/puppet/plugin.rb
 INFO manager: Registered plugin: puppet
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/provisioners/cfengine/plugin.rb
 INFO manager: Registered plugin: CFEngine Provisioner
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/provisioners/docker/plugin.rb
 INFO manager: Registered plugin: docker
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/provisioners/shell/plugin.rb
 INFO manager: Registered plugin: shell
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/provisioners/ansible/plugin.rb
 INFO manager: Registered plugin: ansible
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/provisioners/salt/plugin.rb
 INFO manager: Registered plugin: salt
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/provisioners/file/plugin.rb
 INFO manager: Registered plugin: file
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/provisioners/chef/plugin.rb
 INFO manager: Registered plugin: chef
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/kernel_v2/plugin.rb
 INFO manager: Registered plugin: kernel
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/synced_folders/nfs/plugin.rb
 INFO manager: Registered plugin: NFS synced folders
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/synced_folders/rsync/plugin.rb
 INFO manager: Registered plugin: RSync synced folders
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/synced_folders/smb/plugin.rb
 INFO manager: Registered plugin: SMB synced folders
 INFO global: Loading plugins!
DEBUG global: Loading plugin `vagrant-hostsupdater` with default require: `vagrant-hostsupdater`
 INFO manager: Registered plugin: HostsUpdater
DEBUG global: Successfully loaded plugin `vagrant-hostsupdater`.
DEBUG global: Loading plugin `vagrant-rsync-back` with default require: `vagrant-rsync-back`
 INFO manager: Registered plugin: Rsync Back
DEBUG global: Successfully loaded plugin `vagrant-rsync-back`.
DEBUG global: Loading plugin `vagrant-share` with default require: `vagrant-share`
 INFO manager: Registered plugin: vagrant-share
DEBUG global: Successfully loaded plugin `vagrant-share`.
DEBUG global: Loading plugin `vagrant-vbguest` with default require: `vagrant-vbguest`
 INFO manager: Registered plugin: vagrant-vbguest
DEBUG global: Successfully loaded plugin `vagrant-vbguest`.
 INFO vagrant: `vagrant` invoked: ["up", "--debug"]
DEBUG vagrant: Creating Vagrant environment
 INFO environment: Environment initialized (#<Vagrant::Environment:0x00000001bc1a50>)
 INFO environment:   - cwd: /home/david/vagrant/blt-test
 INFO environment: Home path: /home/david/.vagrant.d
DEBUG environment: Effective local data path: /home/david/vagrant/blt-test/.vagrant
 INFO environment: Local data path: /home/david/vagrant/blt-test/.vagrant
DEBUG environment: Creating: /home/david/vagrant/blt-test/.vagrant
 INFO environment: Running hook: environment_plugins_loaded
 INFO runner: Preparing hooks for middleware sequence...
 INFO runner: 2 hooks defined.
 INFO runner: Running action: environment_plugins_loaded #<Vagrant::Action::Builder:0x0000000265a958>
 INFO environment: Running hook: environment_load
 INFO runner: Preparing hooks for middleware sequence...
 INFO runner: 2 hooks defined.
 INFO runner: Running action: environment_load #<Vagrant::Action::Builder:0x000000024545f0>
 INFO cli: CLI: [] "up" []
DEBUG cli: Invoking command class: VagrantPlugins::CommandUp::Command []
DEBUG command: 'Up' each target VM...
 INFO loader: Set :root = ["#<Pathname:/home/david/vagrant/blt-test/Vagrantfile>"]
DEBUG loader: Populating proc cache for #<Pathname:/home/david/vagrant/blt-test/Vagrantfile>
DEBUG loader: Load procs for pathname: /home/david/vagrant/blt-test/Vagrantfile
ERROR loader: Vagrantfile load error: Malformed version number string 2.4.4 (stable-2.4 92cea82a4e) last updated 2018/02/28 20:16:43 (GMT +200)
ERROR loader: /opt/vagrant/embedded/lib/ruby/2.3.0/rubygems/version.rb:207:in `initialize'
/opt/vagrant/embedded/lib/ruby/2.3.0/rubygems/version.rb:199:in `new'
/opt/vagrant/embedded/lib/ruby/2.3.0/rubygems/version.rb:199:in `new'
/home/david/vagrant/blt-test/vendor/geerlingguy/drupal-vm/lib/drupalvm/vagrant.rb:62:in `require_ansible_version'
/home/david/vagrant/blt-test/vendor/geerlingguy/drupal-vm/Vagrantfile:40:in `<top (required)>'
/home/david/vagrant/blt-test/Vagrantfile:13:in `load'
/home/david/vagrant/blt-test/Vagrantfile:13:in `<top (required)>'
/opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/config/loader.rb:219:in `load'
/opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/config/loader.rb:219:in `block in procs_for_path'
/opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/config.rb:53:in `block in capture_configures'
/opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/config.rb:48:in `synchronize'
/opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/config.rb:48:in `capture_configures'
/opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/config/loader.rb:217:in `procs_for_path'
/opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/config/loader.rb:203:in `procs_for_source'
/opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/config/loader.rb:67:in `block in set'
/opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/config/loader.rb:61:in `each'
/opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/config/loader.rb:61:in `set'
/opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/environment.rb:505:in `config_loader'
/opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/environment.rb:810:in `vagrantfile'
/opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/commands/up/command.rb:67:in `execute'
/opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/cli.rb:42:in `execute'
/opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/environment.rb:308:in `cli'
/opt/vagrant/embedded/gems/gems/vagrant-1.9.8/bin/vagrant:138:in `<main>'
 INFO environment: Running hook: environment_unload
 INFO loader: Loading configuration in order: [:home, :root]
DEBUG loader: Configuration loaded successfully, finalizing and returning
DEBUG push: finalizing
 INFO host: Autodetecting host type for [#<Vagrant::Environment: /home/david/vagrant/blt-test>]
DEBUG host: Trying: slackware
DEBUG host: Trying: redhat
DEBUG host: Trying: suse
DEBUG host: Trying: gentoo
DEBUG host: Trying: freebsd
DEBUG host: Trying: arch
DEBUG host: Trying: darwin
DEBUG host: Trying: bsd
DEBUG host: Trying: windows
DEBUG host: Trying: linux
 INFO host: Detected: linux!
 INFO runner: Preparing hooks for middleware sequence...
 INFO runner: 2 hooks defined.
 INFO runner: Running action: environment_unload #<Vagrant::Action::Builder:0x000000025fcb00>
ERROR vagrant: Vagrant experienced an error! Details:
ERROR vagrant: #<Vagrant::Errors::VagrantfileLoadError: There was an error loading a Vagrantfile. The file being loaded
and the error message are shown below. This is usually caused by
a syntax error.

Path: /home/david/vagrant/blt-test/Vagrantfile
Line number: 0
Message: ArgumentError: Malformed version number string 2.4.4 (stable-2.4 92cea82a4e) last updated 2018/02/28 20:16:43 (GMT +200)>
ERROR vagrant: There was an error loading a Vagrantfile. The file being loaded
and the error message are shown below. This is usually caused by
a syntax error.

Path: /home/david/vagrant/blt-test/Vagrantfile
Line number: 0
Message: ArgumentError: Malformed version number string 2.4.4 (stable-2.4 92cea82a4e) last updated 2018/02/28 20:16:43 (GMT +200)
ERROR vagrant: /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/config/loader.rb:245:in `rescue in block in procs_for_path'
/opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/config/loader.rb:218:in `block in procs_for_path'
/opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/config.rb:53:in `block in capture_configures'
/opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/config.rb:48:in `synchronize'
/opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/config.rb:48:in `capture_configures'
/opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/config/loader.rb:217:in `procs_for_path'
/opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/config/loader.rb:203:in `procs_for_source'
/opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/config/loader.rb:67:in `block in set'
/opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/config/loader.rb:61:in `each'
/opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/config/loader.rb:61:in `set'
/opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/environment.rb:505:in `config_loader'
/opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/environment.rb:810:in `vagrantfile'
/opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/commands/up/command.rb:67:in `execute'
/opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/cli.rb:42:in `execute'
/opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/environment.rb:308:in `cli'
/opt/vagrant/embedded/gems/gems/vagrant-1.9.8/bin/vagrant:138:in `<main>'
 INFO interface: error: There was an error loading a Vagrantfile. The file being loaded
and the error message are shown below. This is usually caused by
a syntax error.

Path: /home/david/vagrant/blt-test/Vagrantfile
Line number: 0
Message: ArgumentError: Malformed version number string 2.4.4 (stable-2.4 92cea82a4e) last updated 2018/02/28 20:16:43 (GMT +200)
There was an error loading a Vagrantfile. The file being loaded
and the error message are shown below. This is usually caused by
a syntax error.

Path: /home/david/vagrant/blt-test/Vagrantfile
Line number: 0
Message: ArgumentError: Malformed version number string 2.4.4 (stable-2.4 92cea82a4e) last updated 2018/02/28 20:16:43 (GMT +200)
 INFO interface: Machine: error-exit ["Vagrant::Errors::VagrantfileLoadError", "There was an error loading a Vagrantfile. The file being loaded\nand the error message are shown below. This is usually caused by\na syntax error.\n\nPath: /home/david/vagrant/blt-test/Vagrantfile\nLine number: 0\nMessage: ArgumentError: Malformed version number string 2.4.4 (stable-2.4 92cea82a4e) last updated 2018/02/28 20:16:43 (GMT +200)"]

Summary

I get this error when try to start a virtual machine, with ansible installed via git. The problem seens to be related with the fact that drupalvm is not able to process the output of ansible --version command.

dlopez-akalam commented 6 years ago

Related original issue on acquia/blt https://github.com/acquia/blt/issues/2610

FinBoWa commented 6 years ago

@dlopez-akalam why not install ansible with brew or through system package manager?

If ansible works from the sources only with root then you haven't set the right permissions to the build files.

Personally I'd say that this would be out of scope relating drupal vm as it requires functional ansible, vagrant and virtualbox. And as your ansible wont run without elevated privileges so I'm not sure is this the right place to ask help.

FinBoWa commented 6 years ago

Thought i did a quick snoop trough This is the part that gets the version number:

https://github.com/geerlingguy/drupal-vm/blob/789266c848a7681d5dd7916cafc8e23b04d1b4f6/lib/drupalvm/vagrant.rb#L53-L56

And this is probably failing:

https://github.com/geerlingguy/drupal-vm/blob/789266c848a7681d5dd7916cafc8e23b04d1b4f6/lib/drupalvm/vagrant.rb#L62

so I'd presume Gem::Version.new cant handle some of the extra strings that the source build ansible is adding to the version line of ansible --version

But is that something to fix on drupalvms files vagrant rb file is the interesting bit > I'd say no unless ansibles builds start to output some more info on the version part

rsanzante commented 6 years ago

I think this is a Drupal VM bug as long as it's unable to parse the Ansible version. I've created a PR that changes the regexp to ignore part in parenthesis, see https://github.com/geerlingguy/drupal-vm/pull/1726

geerlingguy commented 6 years ago

This is fixed in @rsanzante's PR #1726 - thanks!

(It's currently in Drupal VM dev/master only, I have not yet created a release with this fix).

philipnorton42 commented 6 years ago

Sorry, I don't think this has fixed the issue. Or it may have created a different issue? I had some problems setting up a new DrupalVM box this morning from a master branch version of DrupalVM. I eventually tied it down to this change. Reverting the change appeared to fix this issue.

Here is the error I was seeing. It looks like the whole ansible version output is being included as the version number.

There was an error loading a Vagrantfile. The file being loaded
and the error message are shown below. This is usually caused by
a syntax error.

Path: /Users/someone/Sites/project/Vagrantfile
Line number: 0
Message: ArgumentError: Malformed version number string 2.4.3.0
  config file = None
  configured module search path = [u'/Users/someone/.ansible/plugins/modules', 
  u'/usr/share/ansible/plugins/modules']
  ansible python module location = /Library/Python/2.7/site-packages/ansible

  executable location = /usr/local/bin/ansible-playbook python version = 2.7.10`

Here is the output of my ansible --version

→ ansible --version
ansible 2.4.3.0
  config file = None
  configured module search path = [u'/Users/someone/.ansible/plugins/modules', 
  u'/usr/share/ansible/plugins/modules']
  ansible python module location = /Library/Python/2.7/site-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 2.7.10 (default, Feb  7 2017, 00:08:15) [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)]

If you need any more information then let me know.

rsanzante commented 6 years ago

@philipnorton42 What OS are you using?

oxyc commented 6 years ago

I guess it's matching the trailing whitespace:

/^[^\s]+ ([^\(]+).*$/

should be

/^[^\s]+ ([^\(\s]+).*$/

Maybe worth making the trailing string explicitly lazy as well?

/^[^\s]+ ([^\(\s]+).*?$/

Edit: or just remove the trailing string, I don't think there's a reason for it:

/^[^\s]+ ([^\(\s]+)/
rsanzante commented 6 years ago

I asked for the OS because a colleague with MacOS today reported an error with this regular expression.

The problem is the last number, for example, the '0' in 2.4.3.0. In OSX this triggers an error while in Linux it doesn't.

He solved using this regexp: /^[^\s]+ ((?:\d\.){2}\d).*$/

See it in action in this link: http://rubular.com/r/J4TBshh16b

@oxyc Those expression matches the last number as well so I guess they don't solve the issue.

I'm going to create a new PR.

rsanzante commented 6 years ago

PR done! I can't reopen this issue, should I create a new issue!

Sorry for the first regexp :-1:

jpmc commented 6 years ago

I wanted to chime in I had the exact same error with the same version of Ansible, except on Ubuntu 16.04.2 LTS, Linux 4.10.0-28-generic kernel.

Though I haven't tested the new regex yet, I thought it might be useful to at least confirm the issue is present on more than one OS.

philipnorton42 commented 6 years ago

@rsanzante For what it's worth I am running osx Sierra. Thanks for the update though, I will test the regex in the morning (UK time).

FinBoWa commented 6 years ago

Alternative way for matching: https://stackoverflow.com/questions/8955657/regex-pattern-to-extract-version-number-from-string eg.

\d+(\.\d+)+

That seems to just match any continous numbers and commas and atleast it matches the number part for something like 5.0.0-patch . Directly that doesn't group like what you have but I thought worth to point out as an alternative.

rsanzante commented 6 years ago

@FinBoWa That expression would match 2.4.1.0 instead of 2.4.1, so the error would still be present. Proposed regexp in https://github.com/geerlingguy/drupal-vm/issues/1725#issuecomment-374749602 would match 5.0.0 from "ansible 5.0.0-alpha", see http://rubular.com/r/J4TBshh16b.

oxyc commented 6 years ago

The old regex before #1726 did parse 2.4.3.0 correctly though?

rsanzante commented 6 years ago

@oxyc, no because it parsed 2.4.1.0 instead of 2.4.1. Semver only has three numbers, not four, see https://semver.org/.

I guess the code that drupal vm depending on OS enforces the three numbers and triggers an error if it receives four numbers.

oxyc commented 6 years ago

But this has been working fine since it was introduced in https://github.com/geerlingguy/drupal-vm/commit/ae4c8031d7ff6f8e362595bbca2acdc7e2594167, https://github.com/geerlingguy/drupal-vm/commit/350851b573f16910b509b49d8a0ffd95dbea703f so I don't think the 4th digit can be the cause.

Gems::Version parser source

FinBoWa commented 6 years ago
ansible_version = "2.4.1.0-patch1"
req = Gem::Requirement.new(">2.4")

if req.satisfied_by?(Gem::Version.new(ansible_version))
   puts "yes"
else
   puts "no"
end

That works but if you put something else there you get a similar error

ansible_version = "2.4.1.0-patch1 thiscausestheerror"
req = Gem::Requirement.new(">2.4")

if req.satisfied_by?(Gem::Version.new(ansible_version))
   puts "yes"
else
   puts "no"
end

So the amount of should not be the cause of the error and even the -patch sring works . So the rexgp is getting something more than just the actual version, maybe a cr char or something?

rsanzante commented 6 years ago

@oxyc I don't have an answer for that. It strange because old regexp from https://github.com/geerlingguy/drupal-vm/pull/1726 matches the same as regexp from https://github.com/geerlingguy/drupal-vm/commit/410e8788a719777f4f23fd93b46c1b5b5d422091.

Anyway, I think version detection should stick to Semver, just 3 numbers. That's what new PR does (https://github.com/geerlingguy/drupal-vm/pull/1739).

See the three regexs in action

@FinBoWa I don't see any garbage chars in the matches from rubular.com. Maybe their engine is not so similar to Ruby's engine?

FinBoWa commented 6 years ago

I'm just pointing out that you are dropping version information on the wrong premises that the fourth digit was the cause of the issue and at least for me it doesn't seem that way as the ruby Gem::Version.new(ansible_version) is cabable of handling it > somethign else is probably causing the issues.

Anyways: personally im not happy dropping the fourth as its just mere forcing a string to be "semver" if it wasnt that already the string is still valid version with any number of digits.

FinBoWa commented 6 years ago

But im not part of the drupal vm team so these are just my point of view so take them as that way :D

oxyc commented 6 years ago

@philipnorton42 @jpmc which ruby and gem versions do you have?

ruby --version
gem --version
oxyc commented 6 years ago

I can confirm I get the same error on macOS with:

drupal-vm-test master*: ruby --version
ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-darwin17]

drupal-vm-test master*: gem --version
2.7.4

Ensuring the trailing whitespace isn't in the version fixes it for me. I couldn't reproduce this with just a simple trailing whitespace in tests though, maybe it's another space character? In which case \s would cover that.

# Return the ansible version parsed from running the executable path provided.
def ansible_version
  /^[^\s]+ ([^\s]+)/.match(`#{ansible_bin} --version`) { |match| return match[1] }
end
oxyc commented 6 years ago

@rsanzante any chance you and your colleague could test the alternative PR i opened at #1740? If you can confirm it works it's always nicer to be able to lock the full Ansible version :) As I couldn't find the exact cause for the bug I'm still not entirely confident so would appreciate if you could give it a try.

BanovMiroslav commented 6 years ago

I have the same issue as @philipnorton42. Either of patch #1739 or #1740 fixes the issue for me.