2

我在https://puphpet.com/创建了一个默认的 Vagrant 配置

这是档案的链接:http: //www.pastefile.com/hynLN4

我在 Ubuntu 14.04 x64 和 Vagrant 1.7.4 上运行

我收到以下错误Error: Duplicate declaration: Mysql_user[root@localhost]

这是安装日志

vagrant up
sh: 1: netsh: not found
sh: 1: cscript: not found
It seems that you don't have the privileges to change the firewall rules. NFS will not work without that firewall
changes. Execute the following commands via cmd as administrator:
netsh advfirewall firewall add rule name="VagrantWinNFSd-1.1.0" dir="in" action=allow protocol=any program="\home\grek\.vagrant.d\gems\gems\vagrant-winnfsd-1.1.0\bin\winnfsd.exe" profile=any
netsh advfirewall firewall add rule name="VagrantWinNFSd-1.1.0" dir="out" action=allow protocol=any program="\home\grek\.vagrant.d\gems\gems\vagrant-winnfsd-1.1.0\bin\winnfsd.exe" profile=any
If you are an Windows XP user run the following command instead:
netsh firewall add allowedprogram "\home\grek\.vagrant.d\gems\gems\vagrant-winnfsd-1.1.0\bin\winnfsd.exe" VagrantWinNFSd-1.1.0 ENABLE
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'puphpet/ubuntu1404-x64'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'puphpet/ubuntu1404-x64' is up to date...
==> default: Setting the name of the VM: J4oxiT_default_1440513805447_78063
==> default: Pruning invalid NFS exports. Administrator privileges will be required...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
    default: Adapter 2: hostonly
==> default: Forwarding ports...
    default: 22 => 6905 (adapter 1)
    default: 22 => 2222 (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: Warning: Connection timeout. Retrying...
    default: 
    default: Vagrant insecure key detected. Vagrant will automatically replace
    default: this with a newly generated keypair for better security.
    default: 
    default: Inserting generated public key within guest...
    default: Removing insecure key from the guest if it's present...
    default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Setting hostname...
==> default: Configuring and enabling network interfaces...
==> default: Installing NFS client...
==> default: Exporting NFS shared folders...
==> default: Preparing to edit /etc/exports. Administrator privileges will be required...
nfsd running
exportfs: duplicated export entries:
exportfs:       192.168.56.107:/home/grek/Downloads/J4oxiT
exportfs:       192.168.56.107:/home/grek/Downloads/J4oxiT
==> default: Mounting NFS shared folders...
==> default: Running provisioner: shell...
    default: Running: inline script
==> default: stdin: is not a tty
==> default: Running provisioner: shell...
    default: Running: /tmp/vagrant-shell20150825-10700-espnt2.sh
==> default: stdin: is not a tty
==> default: 
==> default:  ____        ____  _   _ ____      _      generated using
==> default: |  _ \ _   _|  _ \| | | |  _ \ ___| |_   ___ ___  _ __ ___
==> default: | |_) | | | | |_) | |_| | |_) / _ \ __| / __/ _ \| '_ ` _ \
==> default: |  __/| |_| |  __/|  _  |  __/  __/ |_ | (_| (_) | | | | | |
==> default: |_|    \__,_|_|   |_| |_|_|   \___|\__(_)___\___/|_| |_| |_|
==> default: 
==> default: Running initial-setup apt-get update
==> default: Finished running initial-setup apt-get update
==> default: Running provisioner: shell...
    default: Running: /tmp/vagrant-shell20150825-10700-dijdg1.sh
==> default: stdin: is not a tty
==> default: Generating public/private rsa key pair.
==> default: Your identification has been saved in /vagrant/puphpet/files/dot/ssh/root_id_rsa.
==> default: Your public key has been saved in /vagrant/puphpet/files/dot/ssh/root_id_rsa.pub.
==> default: The key fingerprint is:
==> default: 47:ed:6d:21:16:2d:64:e3:8a:c5:7a:41:4f:36:20:d8 root@miejsce
==> default: The key's randomart image is:
==> default: +--[ RSA 2048]----+
==> default: |       o. ooO.   |
==> default: |      . E+ B.+.  |
==> default: |          = *..  |
==> default: |         = = o . |
==> default: |        S + . o  |
==> default: |         o   .   |
==> default: |                 |
==> default: |                 |
==> default: |                 |
==> default: +-----------------+
==> default: dpkg-preconfigure: unable to re-open stdin: No such file or directory
==> default: Your private key for SSH-based authentication has been saved to 'puphpet/files/dot/ssh/root_id_rsa'!
==> default: Generating public/private rsa key pair.
==> default: Your identification has been saved in /vagrant/puphpet/files/dot/ssh/id_rsa.
==> default: Your public key has been saved in /vagrant/puphpet/files/dot/ssh/id_rsa.pub.
==> default: The key fingerprint is:
==> default: fd:15:9a:cb:04:db:49:cf:47:2c:71:24:18:05:94:a4 root@miejsce
==> default: The key's randomart image is:
==> default: +--[ RSA 2048]----+
==> default: |           o=*+.o|
==> default: |           .o  = |
==> default: |          E . o o|
==> default: |         . = * + |
==> default: |        S o * + .|
==> default: |           + o . |
==> default: |            +    |
==> default: |                 |
==> default: |                 |
==> default: +-----------------+
==> default: Your private key for SSH-based authentication has been saved to 'puphpet/files/dot/ssh/id_rsa'!
==> default: Adding generated root key to /root/.ssh/id_rsa
==> default: Adding generated root key to /root/.ssh/id_rsa.pub
==> default: Adding generated root key to /root/.ssh/authorized_keys
==> default: Adding generated key to /home/vagrant/.ssh/id_rsa
==> default: Adding generated key to /home/vagrant/.ssh/id_rsa.pub
==> default: Adding generated key to /home/vagrant/.ssh/authorized_keys
==> default: Running provisioner: shell...
    default: Running: /tmp/vagrant-shell20150825-10700-1yg483r.sh
==> default: stdin: is not a tty
==> default: Running provisioner: shell...
    default: Running: /tmp/vagrant-shell20150825-10700-rzxlnu.sh
==> default: stdin: is not a tty
==> default: Running provisioner: shell...
    default: Running: /tmp/vagrant-shell20150825-10700-qq98jx.sh
==> default: stdin: is not a tty
==> default: Successfully installed deep_merge-1.0.1
==> default: 1 gem installed
==> default: Successfully installed thread_safe-0.3.5
==> default: Successfully installed minitest-5.8.0
==> default: Successfully installed tzinfo-1.2.2
==> default: Successfully installed i18n-0.7.0
==> default: Successfully installed activesupport-4.2.4
==> default: 5 gems installed
==> default: Successfully installed vine-0.2
==> default: 1 gem installed
==> default: Running provisioner: puppet...
==> default: Running Puppet with site.pp...
==> default: stdin: is not a tty
==> default: Info: Loading facts in /tmp/vagrant-puppet/modules-50924535ae1383472e9602acc4a05036/java/lib/facter/java_patch_level.rb
==> default: Info: Loading facts in /tmp/vagrant-puppet/modules-50924535ae1383472e9602acc4a05036/java/lib/facter/java_major_version.rb
==> default: Info: Loading facts in /tmp/vagrant-puppet/modules-50924535ae1383472e9602acc4a05036/java/lib/facter/java_version.rb
==> default: Info: Loading facts in /tmp/vagrant-puppet/modules-50924535ae1383472e9602acc4a05036/composer/lib/facter/composer_home.rb
==> default: Info: Loading facts in /tmp/vagrant-puppet/modules-50924535ae1383472e9602acc4a05036/stdlib/lib/facter/puppet_vardir.rb
==> default: Info: Loading facts in /tmp/vagrant-puppet/modules-50924535ae1383472e9602acc4a05036/stdlib/lib/facter/root_home.rb
==> default: Info: Loading facts in /tmp/vagrant-puppet/modules-50924535ae1383472e9602acc4a05036/stdlib/lib/facter/pe_version.rb
==> default: Info: Loading facts in /tmp/vagrant-puppet/modules-50924535ae1383472e9602acc4a05036/stdlib/lib/facter/facter_dot_d.rb
==> default: Info: Loading facts in /tmp/vagrant-puppet/modules-50924535ae1383472e9602acc4a05036/git/lib/facter/git_exec_path.rb
==> default: Info: Loading facts in /tmp/vagrant-puppet/modules-50924535ae1383472e9602acc4a05036/git/lib/facter/git_version.rb
==> default: Info: Loading facts in /tmp/vagrant-puppet/modules-50924535ae1383472e9602acc4a05036/php/lib/facter/php_fact_version.rb
==> default: Info: Loading facts in /tmp/vagrant-puppet/modules-50924535ae1383472e9602acc4a05036/php/lib/facter/php_fact_extension_dir.rb
==> default: Info: Loading facts in /tmp/vagrant-puppet/modules-50924535ae1383472e9602acc4a05036/rvm/lib/facter/rvm_version.rb
==> default: Info: Loading facts in /tmp/vagrant-puppet/modules-50924535ae1383472e9602acc4a05036/rvm/lib/facter/rvm_installed.rb
==> default: Info: Loading facts in /tmp/vagrant-puppet/modules-50924535ae1383472e9602acc4a05036/firewall/lib/facter/ip6tables_version.rb
==> default: Info: Loading facts in /tmp/vagrant-puppet/modules-50924535ae1383472e9602acc4a05036/firewall/lib/facter/iptables_persistent_version.rb
==> default: Info: Loading facts in /tmp/vagrant-puppet/modules-50924535ae1383472e9602acc4a05036/firewall/lib/facter/iptables_version.rb
==> default: Info: Loading facts in /tmp/vagrant-puppet/modules-50924535ae1383472e9602acc4a05036/apt/lib/facter/apt_update_last_success.rb
==> default: Info: Loading facts in /tmp/vagrant-puppet/modules-50924535ae1383472e9602acc4a05036/apt/lib/facter/apt_updates.rb
==> default: Info: Loading facts in /tmp/vagrant-puppet/modules-50924535ae1383472e9602acc4a05036/staging/lib/facter/staging_http_get.rb
==> default: Info: Loading facts in /tmp/vagrant-puppet/modules-50924535ae1383472e9602acc4a05036/staging/lib/facter/staging_windir.rb
==> default: Info: Loading facts in /tmp/vagrant-puppet/modules-50924535ae1383472e9602acc4a05036/puppi/lib/facter/last_run.rb
==> default: Info: Loading facts in /tmp/vagrant-puppet/modules-50924535ae1383472e9602acc4a05036/puppi/lib/facter/windows_common_appdata.rb
==> default: Info: Loading facts in /tmp/vagrant-puppet/modules-50924535ae1383472e9602acc4a05036/puppi/lib/facter/puppi_projects.rb
==> default: Info: Loading facts in /tmp/vagrant-puppet/modules-50924535ae1383472e9602acc4a05036/concat/lib/facter/concat_basedir.rb
==> default: Error: Duplicate declaration: Mysql_user[root@localhost] is already declared in file /tmp/vagrant-puppet/modules-50924535ae1383472e9602acc4a05036/mysql/manifests/server/root_password.pp:8; cannot redeclare at /tmp/vagrant-puppet/manifests-893fcda21077f5a583c2dbbba8515c0a/nodes/Mysql.pp:93 on node miejsce.puphpet
==> default: Error: Duplicate declaration: Mysql_user[root@localhost] is already declared in file /tmp/vagrant-puppet/modules-50924535ae1383472e9602acc4a05036/mysql/manifests/server/root_password.pp:8; cannot redeclare at /tmp/vagrant-puppet/manifests-893fcda21077f5a583c2dbbba8515c0a/nodes/Mysql.pp:93 on node miejsce.puphpet
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.

这里是生成的 config.yaml

vagrantfile:
    target: local
    vm:
        box: puphpet/ubuntu1404-x64
        box_url: puphpet/ubuntu1404-x64
        hostname: miejsce.puphpet
        memory: '510'
        cpus: '2'
        chosen_provider: virtualbox
        network:
            private_network: 192.168.56.107
            forwarded_port:
                vflnp_ad1r2saedeui:
                    host: '6905'
                    guest: '22'
        post_up_message: ''
        provider:
            virtualbox:
                modifyvm:
                    natdnshostresolver1: 'on'
                showgui: '0'
            vmware:
                numvcpus: 1
            parallels:
                cpus: 1
        provision:
            puppet:
                manifests_path: puphpet/puppet
                manifest_file: site.pp
                module_path: puphpet/puppet/modules
                options:
                    - '--verbose'
                    - '--hiera_config /vagrant/puphpet/puppet/hiera.yaml'
                    - '--parser future'
        synced_folder:
            vflsf_llda9cymf6sn:
                source: ./
                target: /var/www
                sync_type: nfs
                smb:
                    smb_host: ''
                    smb_username: ''
                    smb_password: ''
                rsync:
                    args:
                        - '--verbose'
                        - '--archive'
                        - '-z'
                    exclude:
                        - .vagrant/
                        - .git/
                    auto: 'true'
                owner: www-data
                group: www-data
        usable_port_range:
            start: 10200
            stop: 10500
    ssh:
        host: null
        port: null
        private_key_path: null
        username: vagrant
        guest_port: null
        keep_alive: true
        forward_agent: false
        forward_x11: false
        shell: 'bash -l'
    vagrant:
        host: detect
server:
    install: '1'
    packages: {  }
users_groups:
    install: '1'
    groups: {  }
    users:
        - vagrant
locale:
    install: '1'
    settings:
        default_locale: pl_PL.UTF-8
        locales:
            - en_GB.UTF-8
            - en_US.UTF-8
firewall:
    install: '1'
    rules: {  }
cron:
    install: '1'
    jobs: {  }
nginx:
    install: '1'
    settings:
        default_vhost: 1
        proxy_buffer_size: 128k
        proxy_buffers: '4 256k'
    upstreams: {  }
    vhosts:
        nxv_nbadq0pidkx5:
            server_name: miejsce2.dev
            www_root: /var/www/miejsce2
            listen_port: '80'
            index_files:
                - index.html
                - index.htm
                - index.php
            client_max_body_size: 50m
            ssl: '0'
            ssl_cert: ''
            ssl_key: ''
            ssl_port: '443'
            ssl_protocols: ''
            ssl_ciphers: ''
            rewrite_to_https: '1'
            spdy: '1'
            locations:
                nxvl_hvjg0kq9gccz:
                    location: /
                    autoindex: 'off'
                    try_files:
                        - $uri
                        - $uri/
                        - /index.php$is_args$args
                    fastcgi: ''
                    fastcgi_index: ''
                    fastcgi_split_path: ''
                nxvl_yv1jp9sq6j6a:
                    location: '~ \.php$'
                    autoindex: 'off'
                    try_files:
                        - $uri
                        - $uri/
                        - /index.php$is_args$args
                    fastcgi: '127.0.0.1:9000'
                    fastcgi_index: index.php
                    fastcgi_split_path: '^(.+\.php)(/.*)$'
                    fast_cgi_params_extra:
                        - 'SCRIPT_FILENAME $request_filename'
                        - 'APP_ENV dev'
    proxies: {  }
apache:
    install: '0'
    settings:
        user: www-data
        group: www-data
        default_vhost: true
        manage_user: false
        manage_group: false
        sendfile: 0
    modules:
        - proxy_fcgi
        - rewrite
    vhosts:
        av_c0xxvoygs0ua:
            servername: awesome.dev
            serveraliases:
                - www.awesome.dev
            docroot: /var/www/awesome
            port: '80'
            setenv:
                - 'APP_ENV dev'
            custom_fragment: ''
            ssl: '0'
            ssl_cert: ''
            ssl_key: ''
            ssl_chain: ''
            ssl_certs_dir: ''
            ssl_protocol: ''
            ssl_cipher: ''
            directories:
                avd_ulclfk4slp9n:
                    path: /var/www/awesome
                    options:
                        - Indexes
                        - FollowSymlinks
                        - MultiViews
                    allow_override:
                        - All
                    require:
                        - 'all granted'
                    custom_fragment: ''
                    files_match:
                        avdfm_4wpe1x4nbxlu:
                            path: \.php$
                            sethandler: 'proxy:fcgi://127.0.0.1:9000'
                            custom_fragment: ''
                            provider: filesmatch
                    provider: directory
php:
    install: '1'
    settings:
        version: '56'
    modules:
        php:
            - cli
            - intl
            - mcrypt
        pear: {  }
        pecl: {  }
    ini:
        display_errors: 'On'
        error_reporting: '-1'
        session.save_path: /var/lib/php/session
        date.timezone: UTC
    fpm_ini:
        error_log: /var/log/php-fpm.log
    fpm_pools:
        phpfp_2bxtt7d9nxiw:
            ini:
                prefix: www
                listen: '127.0.0.1:9000'
                security.limit_extensions: .php
                group: www-data
                user: vagrant
    composer: '1'
    composer_home: ''
xdebug:
    install: '0'
    settings:
        xdebug.default_enable: '1'
        xdebug.remote_autostart: '0'
        xdebug.remote_connect_back: '1'
        xdebug.remote_enable: '1'
        xdebug.remote_handler: dbgp
        xdebug.remote_port: '9000'
blackfire:
    install: '0'
    settings:
        server_id: ''
        server_token: ''
        agent:
            http_proxy: ''
            https_proxy: ''
            log_file: stderr
            log_level: '1'
        php:
            agent_timeout: '0.25'
            log_file: ''
            log_level: '1'
xhprof:
    install: '0'
wpcli:
    install: '0'
    version: v0.19.0
drush:
    install: '0'
    version: 6.3.0
ruby:
    install: '1'
    versions: {  }
python:
    install: '1'
    packages: {  }
    versions: {  }
nodejs:
    install: '1'
    npm_packages: {  }
hhvm:
    install: '0'
    nightly: 0
    composer: '1'
    composer_home: ''
    settings: {  }
    server_ini:
        hhvm.server.host: 127.0.0.1
        hhvm.server.port: '9000'
        hhvm.log.use_log_file: '1'
        hhvm.log.file: /var/log/hhvm/error.log
    php_ini:
        display_errors: 'On'
        error_reporting: '-1'
        date.timezone: UTC
mysql:
    install: '1'
    settings:
        version: '5.6'
        root_password: '123'
        override_options: {  }
    adminer: '1'
    users:
        mysqlnu_1z6h8uzuy4p0:
            name: root
            password: '123'
    databases:
        mysqlnd_o77602w1wz6s:
            name: miejsce
            sql: ''
    grants: {  }
mariadb:
    install: '0'
    settings:
        version: '10.0'
        root_password: '123'
        override_options: {  }
    adminer: 0
    users:
        mariadbnu_ak6wptjhr6j6:
            name: dbuser
            password: '123'
    databases:
        mariadbnd_ak8fy2jlb24t:
            name: dbname
            sql: ''
    grants:
        mariadbng_rpg0pnbx8zlu:
            user: dbuser
            table: '*.*'
            privileges:
                - ALL
postgresql:
    install: '0'
    settings:
        global:
            encoding: UTF8
            version: '9.3'
        server:
            postgres_password: '123'
    databases: {  }
    users: {  }
    grants: {  }
    adminer: 0
mongodb:
    install: '0'
    settings:
        auth: 1
        bind_ip: 127.0.0.1
        port: '27017'
    databases: {  }
redis:
    install: '1'
    settings:
        conf_port: '6379'
sqlite:
    install: '0'
    adminer: 0
    databases: {  }
mailcatcher:
    install: '0'
    settings:
        smtp_ip: 0.0.0.0
        smtp_port: 1025
        http_ip: 0.0.0.0
        http_port: '1080'
        mailcatcher_path: /usr/local/rvm/wrappers/default
        from_email_method: inline
beanstalkd:
    install: '0'
    settings:
        listenaddress: 0.0.0.0
        listenport: '13000'
        maxjobsize: '65535'
        maxconnections: '1024'
        binlogdir: /var/lib/beanstalkd/binlog
        binlogfsync: null
        binlogsize: '10485760'
    beanstalk_console: 0
rabbitmq:
    install: '0'
    settings:
        port: '5672'
    users: {  }
    vhosts: {  }
    plugins: {  }
elastic_search:
    install: '1'
    settings:
        version: 1.4.1
        java_install: true
solr:
    install: '0'
    settings:
        version: 4.10.2
        port: '8984'
4

1 回答 1

4

你在 config.yaml 文件中声明一个 root 用户:

mysql:
    install: '1'
    settings:
        version: '5.6'
        root_password: '123'
        override_options: {  }
    adminer: '1'
    users:
        mysqlnu_1z6h8uzuy4p0:
            name: root
            password: '123'
    databases:
        mysqlnd_o77602w1wz6s:
            name: miejsce
            sql: ''
    grants: {  }

但基于https://github.com/puphpet/puphpet/issues/344,您只能将一个用户分配给数据库 - 尝试设置另一个用户而不是 root 并且它应该可以工作。

于 2015-08-25T16:16:27.820 回答