Coder Social home page Coder Social logo

ansible-skeleton's People

Contributors

bertvv avatar jeroened avatar jonasverhofste avatar mathiasstadler avatar thecodesmith avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ansible-skeleton's Issues

ArgumentError for network options

When running vagrant up, we get an ArgumentError about the network configuration:

$ vagrant up
/opt/vagrant/embedded/gems/gems/vagrant-2.3.7/plugins/kernel_v2/config/vm.rb:319:in `network': wrong number of arguments (given 2, expected 1) (ArgumentError)
        from /home/thomas/source/infra-auto/infra-2223-thomasaelbrecht/vmlab/Vagrantfile:151:in `block (3 levels) in <top (required)>'
        from /opt/vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/config/v2/loader.rb:37:in `load'
        from /opt/vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/config/loader.rb:126:in `block (2 levels) in load'
        from /opt/vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/config/loader.rb:119:in `each'
        from /opt/vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/config/loader.rb:119:in `block in load'
        from /opt/vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/config/loader.rb:116:in `each'
        from /opt/vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/config/loader.rb:116:in `load'
        from /opt/vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/vagrantfile.rb:174:in `machine_config'
        from /opt/vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/environment.rb:983:in `block in find_configured_plugins'
        from /opt/vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/environment.rb:981:in `each'
        from /opt/vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/environment.rb:981:in `find_configured_plugins'
        from /opt/vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/environment.rb:1008:in `process_configured_plugins'
        from /opt/vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/environment.rb:189:in `initialize'
        from /opt/vagrant/embedded/gems/gems/vagrant-2.3.7/bin/vagrant:211:in `new'
        from /opt/vagrant/embedded/gems/gems/vagrant-2.3.7/bin/vagrant:211:in `<main>'

The solution for this is changing this line:

node.vm.network :private_network, network_options(host)

into:

node.vm.network :private_network, **network_options(host)

Generic ansible-playbook script

There are now two script for running a playbook, one for Windows hosts (script runs on the guest, and installs Ansible when necessary), one for Unix-hosts (script runs on host system).

Maybe it would be better to unify this.

Vagrantfile module for Ansible based on your work with modifications that may interest you

Hello!

Needing to control Vagrant from Ansible roles or playbooks (for cluster testing purpose), I had to write a collection of modules to handle Vagrant commands and Vagrantfile. For this second part, your work is the best I found during my tech monitoring so I integrated some of it in mine.

Here is my collection repo: https://github.com/jclaveau/ansible-vagrant-modules

To be les opiniated as you, I had to modify some parts of your code:

  • Support of multiple provisionners with all their possible parameters
  • Support of all possible parameters for forwarded_ports (makes overwriting of ssh ports possible)
  • Optional vagrant-groups.yml file
  • Warning removal due to Ruby's ** splat operator
  • Tests with ansible-test and continuous integration with Github Actions

You can find these modifications here: https://github.com/jclaveau/ansible-vagrant-modules/blob/main/plugins/module_utils/Vagrantfile

It diverged quite a lot so I cannot really make a PR but I wanted to notice you of my work so you may take value from it. Thus I open this bug.

I kept the MIT licensed only for the Vagrantfile so you can use it as much as you want. The rest of my collection is in GPLv3+ as the Ansible module development guidelines requires. Obviously, I listed your contributors in the credits of my README.

Thanks a lot for your work!

Here is an example of use (You can see how Ansible yaml fits well with your yaml config):

- name: Add a vm to the Vagrantfile
  jclaveau.vagrant.config:
  args:
    state: "present"
    name: "{{ item }}"
    config:
      box: boxomatic/debian-11
      ansible:
        playbook: "glusterfs_provisionning_playbook.yml"
      shell:
        inline: 'echo "provisionning done"'
      forwarded_ports:
        - host: "808{{ i }}"
          guest: 80
        - host: "8{{ i }}43"
          guest: 443
    loop:
     - srv001
     - srv002
  loop_control:
    index_var: "i"

Thanks a lot for your work

[Question] Thoughts on "ansible_local" instead of custom script

Hi @bertvv,

Thank you for an amazing project! I am currently reviewing and noticed that for Windows you are using a custom script because Ansible is not supported on a Windows hosts. I recently discovered that there is a Ansible Local Provisioner that you can use to run Ansible locally.

What are your thoughts on this? I know this project has been out for a while and might have been before the provisioner so I wanted to know if that was the reason or there is another factor that made you chose a custom script.

Again thank you for making this available.

Split up variables into separate environments

E.g directory structure like:

ansible/roles/
  environments/
    common/      -> don't know if this will work since it's not an inventory directory
      group_vars/
      host_vars/
    development/
      group_vars/
        all.yml
        webservers.yml
      host_vars/
        srv001.yml
        srv002.yml
      inventory     -> link to Vagrant inventory?
    production/
      group_vars/
        all.yml
        webservers.yml
      host_vars/
        srv001.yml
        srv002.yml
      inventory

See http://www.geedew.com/setting-up-ansible-for-multiple-environment-deployments/

In VirtualBox, create a group for VMs within the same project

In VirtualBox, create a group for VMs within the same project.

In Vagrantfile:

PROJECT_NAME = '/' + File.basename(Dir.getwd)
[...]
  hosts.each do |host|
    config.vm.provider 'virtualbox' do |vb|
      vb.customize ['modifyvm', :id, '--groups', PROJECT_NAME]
    end
[...]

Pull Bats from bats-core not unmaintained sstephenson ?

I noticed while using runbats.sh that it is pulling an older version, there are new active maintainers at bats-core while the original repository it is pulling from appears to not have merged anything in quite a while.

Wrong version ansible installed

My host OS is windows, so I have to run ansible on the vm I am setting up. This gives me problems when setting up a fedora 24 client, because the version of ansible that gets installed is 2.2.0, which means that your other ansible roles don't fully work anymore

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.