Git Product home page Git Product logo

ansible-silo's People

Contributors

udondan avatar woneill 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  avatar  avatar  avatar

ansible-silo's Issues

option -tty incompatible with vagrant

Hi,

I have a problem using ansible-silo with vagrant. When doing vagrant provision, I get

the input device is not a TTY
Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.

I see the option is hard coded in the run script

command="${docker_cmd} run --interactive --tty --rm"

For the moment I manually remove the --tty option. Is it possible to add a user option or an environment variable to chose if I want tty option or not?

Thanks

Juan

adding rsync to use synchronize ansible module

Hi,

I need to use synchronize module but the rsync program is not installed in the container.

Could you tell me the procedure to install it? I'm trying

$ ansible-silo --shell 'sudo apk add --no-cache  rsync'
fetch http://dl-cdn.alpinelinux.org/alpine/v3.6/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.6/community/x86_64/APKINDEX.tar.gz
fetch http://dl-4.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz
WARNING: This apk-tools is OLD! Some packages might not function properly.
(1/4) Installing libattr (2.4.47-r6)
(2/4) Installing libacl (2.2.52-r3)
(3/4) Installing popt (1.16-r6)
(4/4) Installing rsync (3.1.3-r0)
Executing busybox-1.26.2-r5.trigger
OK: 129 MiB in 50 packages

But

$ ansible-silo --shell 'which rsync'

Does not show anything.

Thank you

Juan

Weird python behaviors in created bundle

So, it's me again @udondan...

I came across something else that had me and several other people in the open-source community a little stumped and I'm wondering if you have any ideas on what the core of the problem could be.

I don't recall if I ever explained what the end goal of what I'm trying to accomplish was, so I'll back up and attempt to give an big-picture overview of what I have in mind.

I'm trying to use ansible-silo as a base layer for managing networking devices from Cisco and Juniper using embedded playbooks with a python library called napalm.

Using your instructions in issue #52, I was able to create a docker image with all of the dependencies for napalm>=2.3.0 to be installed correctly.

I can successfully connect to Cisco devices and manage them how I would like to, but when I try and connect to Juniper devices, I get the following error:

fatal: [rtp-vba-a]: FAILED! => {"changed": false, "msg": "cannot connect to device: Cannot import \"napalm.junos\". Is the library installed?"}

While attempting to debug the issue, I accessed the "bundle" using --shell and tried to manually import that library:

[ansible-silo 2.1.1|~/playbooks]$ python
Python 2.7.13 (default, Apr 20 2017, 12:13:37)
[GCC 6.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import napalm.junos
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/silo/userspace/lib/python2.7/site-packages/napalm/junos/__init__.py", line 18, in <module>
    from napalm.junos.junos import JunOSDriver  # noqa
  File "/silo/userspace/lib/python2.7/site-packages/napalm/junos/junos.py", line 32, in <module>
    from jnpr.junos import Device
ImportError: No module named jnpr.junos

However, I can see the library IS in fact there and the directory structure and paths are accurate:

[ansible-silo 2.1.1|~/playbooks]$ echo $PYTHONPATH
/silo/userspace/lib/python2.7/site-packages:/silo/userspace/ansible/lib:
[ansible-silo 2.1.0|~/playbooks]$ ls -l /silo/userspace/lib/python2.7/site-packages | grep -E 'napalm|jnpr'
drwxr-xr-x    3 root     root          4096 Feb 20 17:55 jnpr
drwxr-xr-x    9 root     root          4096 Feb 20 17:55 napalm
drwxr-xr-x    2 root     root          4096 Feb 20 17:55 napalm-2.3.0-py2.7.egg-info
[ansible-silo 2.1.1|~/playbooks]$ ls -l /silo/userspace/lib/python2.7/site-packages/jnpr/junos
total 168
-rw-r--r--    1 root     root          1451 Sep 30 20:32 __init__.py
drwxr-xr-x    3 root     root          4096 Feb 20 17:55 cfg
drwxr-xr-x    2 root     root          4096 Feb 20 17:55 cfgro
-rw-r--r--    1 root     root         11186 Sep 30 20:32 console.py
-rw-r--r--    1 root     root          6876 Sep 30 20:32 decorators.py
-rw-r--r--    1 root     root         51930 Sep 30 20:32 device.py
-rw-r--r--    1 root     root          9145 Sep 30 20:32 exception.py
-rw-r--r--    1 root     root         12747 Sep 30 20:32 factcache.py
drwxr-xr-x    2 root     root          4096 Feb 20 17:55 factory
drwxr-xr-x    2 root     root          4096 Feb 20 17:55 facts
-rw-r--r--    1 root     root          6615 Sep 30 20:32 jxml.py
drwxr-xr-x    2 root     root          4096 Feb 20 17:55 ofacts
drwxr-xr-x    2 root     root          4096 Feb 20 17:55 op
drwxr-xr-x    2 root     root          4096 Feb 20 17:55 resources
-rw-r--r--    1 root     root         15938 Sep 30 20:32 rpcmeta.py
drwxr-xr-x    2 root     root          4096 Feb 20 17:55 transport
drwxr-xr-x    2 root     root          4096 Feb 20 17:55 utils
-rw-r--r--    1 root     root           260 Sep 30 20:32 version.py
[ansible-silo 2.1.1|~/playbooks]$ cat /silo/userspace/lib/python2.7/site-packages/jnpr/junos/version.py
VERSION = "2.1.7"
DATE = "2017-Sep-30"

# Augment with the internal version if present
try:
    from jnpr.junos.internal_version import INTERNAL_VERSION
    VERSION += '+internal.' + str(INTERNAL_VERSION)
except ImportError:
    # No internal version
    pass

What is really strange is that using the Docker image python:2.7.14-alpine3.6 it seems to work just fine:

$ docker run -it python:2.7.14-alpine3.6 /bin/sh
Unable to find image 'python:2.7.14-alpine3.6' locally
2.7.14-alpine3.6: Pulling from library/python
605ce1bd3f31: Pull complete
55018be3009c: Pull complete
918ecf7a26fa: Pull complete
9b782e57edd5: Pull complete
Digest: sha256:cb412d77b3a4eec29243e60585dab19ab40f59b6af17a0420d8771eeb399cd6d
Status: Downloaded newer image for python:2.7.14-alpine3.6

/ # apk --no-cache add make gcc libffi-dev musl-dev linux-headers openssl-dev libxml2-dev libxslt-dev
---SNIP---
/ # pip install napalm
---SNIP---
/ # python
Python 2.7.14 (default, Jan 10 2018, 05:38:41)
[GCC 6.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import napalm.junos

I don't encounter that same errors at all.

Now, as I worked though composing the contents of this issue, I've realized that I can try and take grpn/ansible-silo and base it off of python:2.7.14-alpine3.6 instead of alpine:3.6 and see if that solves the problem I'm encountering.

I'll let you know what I find.

Ansible Vault Password File Not Being Found

I had a "basic" installation of Ansible 2.4.0 installed on a VM which I did all of my development for a proof-of-concept on.

Now, I'm trying to move that proof-of-concept environment into a docker container, but am running into issues when using ansible-silo with ansible-vault. Is that a supported feature?

Let me explain my setup a little further. I have some files which I encrypted that my "basic" ansible setup was able to read due to an environment variable called ANSIBLE_VAULT_PASSWORD_FILE which contained the path to a file that contained the password used to decrypt those files.

Now, after "upgrading" to use ansible-silo and running my playbook, I get the following error:

ERROR! The vault password file /home/[USERNAME]/.ansible_vault_pass was not found

But when I execute the command cat home/[USERNAME]/.ansible_vault_pass, it does in fact exist.

Assuming the problem was that the "data" that ansible-silo uses is now the one created by the installation command (defaulting to silo.[USERNAME]), so I found the location of the volume on my VM (discovered by issuing the command docker volume inspect silo.[USERNAME]) and copied the file .ansible_vault_pass to the /_data/ directory of that volume.

Then I changed the existing envrionment variable ANSIBLE_VAULT_PASSWORD_FILE to be just .ansible_vault_pass instead of /home/[USERNAME]/.ansible_vault_pass and ran it again.

However, the error that I'm getting now is the following:

ERROR! The vault password file /home/user/playbooks/.ansible_vault_pass was not found

I'm not sure where the directory /home/user/playbooks/ is located or if I'm going about this in the entirely wrong fashion?

I'd appreciate any help in solving this or providing an alterntive way to accomplish what I'm trying to do from individuals who designed the internal workings of ansible-silo (Thanks for creating it, BTW).

Created "bundle" not building / operating correctly

I'm not sure if this is due to the customization that I asked for in #41, but when running the build 0.0.3 command from inside of the directory structure created by ansible-silo --bundle [NAME HERE], it appears to build correctly, except for this one warning at the very end:

Step 12/12 : ENV BUNDLE_VERSION ${v}
 ---> Running in b0aa38367a97
 ---> 2f438189ef54
Removing intermediate container b0aa38367a97
[Warning] One or more build-args [v] were not consumed
Successfully built 2f438189ef54
Successfully tagged [NAME HERE]:0.0.3

After "installing" the bundle using the command:

docker run --interactive --tty --rm --volume "$HOME/bin:/silo_install_path" [NAME HERE]:latest --install

I can run the which [NAME HERE] command and it correctly displays the path, however, when I run the bundle, I get the following error:

$ [NAME HERE] --version
docker: invalid reference format.
See 'docker run --help'.

In fact, any command which is run produces the same error:

$ [NAME HERE] --shell ls
docker: invalid reference format.
See 'docker run --help'.

As a note, I did change the version in the Dockerfile to match what I mentioned above (0.0.3). I didn't change anything else. Also, I've tried resetting my silo install several times by using the command ansible-silo --reset, but the error still persists.

Thanks for the great work on silo and for continued help on my questions / errors.
Feel free to get a hold of me here or I'm usually hanging around on the NetworkToCode channel on Slack.

On OS X user always has to enter passphrase for protected SSH key

Silo forwards the SSH socket into the container. Docker for Mac does currently not support mounting sockets into a container. Therefore the users ssh key (which gets mounted) is used. If this key is protected by a passphrase the user will always have to unlock the key on every silo call.

The original problem is described here:

There is an experimental workaround we might want to look into, as it seems the problem is not going to be addressed anytime soon on Docker side: https://github.com/uber-common/docker-ssh-agent-forward

Document how to add roles which have dependencies

Looks like a very useful project.

Can you explain how I would go about consuming roles which introduce additional python dependencies, such as the client lib shade for the majority of the openstack roles. Do you just extend the container and apk it in? Currently the only supported install method is pip install, but I see that silo doesn't have pip. Is that a deliberate choice, or can it just be added if required?

Adding dig lookup support in Ansible Silo

The dig lookup is a lookup added in Ansible 1.9 that make it possible to run queries against DNS servers (see https://docs.ansible.com/ansible/2.5/plugins/lookup/dig).

In order to work properly the dig lookup requires the dnspython library (python-dnspython package on Debian). But this library is not available in the current stable version of Ansible Silo (2.2.0).

Is it possible to add dig lookup support in Ansible Silo by installing dnspython in the Ansible Silo docker image ?

Include bcrypt in base image

Hey, its me again... ๐Ÿ˜Š
I've discovered that I need the python package bcrypt>=3.1.3 which requires it to be compiled during the build stage.

While looking into the Dockerfile more closely, I see the that you also compile a number of python packages as well.

From the file base.Dockerfile:

# Install some required python modules which need compiling
    apk add --no-cache gcc=6.3.0-r4\
                       musl=1.1.16-r13\
                       musl-dev=1.1.16-r13\
                       musl-utils=1.1.16-r13\
                       binutils-libs=2.28-r2\
                       binutils=2.28-r2\
                       isl=0.17.1-r0\
                       libgomp=6.3.0-r4\
                       libatomic=6.3.0-r4\
                       pkgconf=1.3.7-r0\
                       libgcc=6.3.0-r4\
                       mpfr3=3.1.5-r0\
                       mpc1=1.0.3-r0\
                       libstdc++=6.3.0-r4\
                       zlib-dev=1.2.11-r0\
                       python2-dev=2.7.13-r1\
                       openssl-dev=1.0.2k-r0\
                       libffi-dev=3.2.1-r3\
                       libxml2-dev=2.9.4-r4\
                       libxslt-dev=1.1.29-r3 &&\

What could I do to convince you to add bcrypt as well?

Alternatively, if you're against that for what ever reason, I'm wondering if you could provide a way for the user to define which packages need to be compiled and included? I have a feeling that would be somewhat more difficult to implement correctly, but thought I would ask anyways.

As always, I'm truly grateful for the help! ๐Ÿ˜„

Missing sshpass

Hello

I'm using some ansible_user=admin ansible_ssh_pass=********, it appears silo is missing sshpass

fatal: [quagile01]: FAILED! => {"failed": true, "msg": "to use the 'ssh' connection type with passwords, you must install the sshpass program"}

Cheers,

did someone already port it to windows??

More a question than an issues.
I'm using extensively these bundeling of Ansible on my Linux environment.
But now i need to have it working on Windows with docker (and without WSL).
Did someone have already done this "conversion" ??

It seems that "only" the ansible-silo bash file need to be rewrited .... but if it's already existing ... it will spare some long night.

Many thank's for this product, and for your answers

Ph Koenig

Missing pyvmomi

Hello

Tried a vmware_guest_snapshot, it seems the docker's missing pyvmomi dep.

Best regards,

Maintained ?

Hi

Last commit's a year old. Is this project maintained ?

Best regards,

ImportError: No module named awscli.clidriver

Hi,

got this error:

ImportError: No module named awscli.clidriver

   "msg": "non-zero return code",
    "rc": 1,
    "start": "2018-07-31 12:49:28.799175",
    "stderr": "Traceback (most recent call last):\n  File \"/silo/userspace/bin/aws\", line 19, in <module>\n    import awscli.clidriver\nImportError: No module named awscli.clidriver",
    "stderr_lines": [
        "Traceback (most recent call last):",
        "  File \"/silo/userspace/bin/aws\", line 19, in <module>",
        "    import awscli.clidriver",
        "ImportError: No module named awscli.clidriver"
    ],

I have awscli installed:

$ ansible-silo --shell pip install awscli
Identity added: /home/user/.ssh/id_rsa (/home/user/.ssh/id_rsa)
/usr/lib/python2.7/site-packages/pip/commands/install.py:194: UserWarning: Disabling all use of wheels due to the use of --build-options / --global-options / --install-options.
  cmdoptions.check_install_build_global(options)
Requirement already satisfied: awscli in /silo/userspace/lib/python2.7/site-packages
Requirement already satisfied: botocore==1.10.66 in /silo/userspace/lib/python2.7/site-packages (from awscli)
Requirement already satisfied: colorama<=0.3.9,>=0.2.5 in /usr/lib/python2.7/site-packages (from awscli)
Requirement already satisfied: docutils>=0.10 in /silo/userspace/lib/python2.7/site-packages (from awscli)
Requirement already satisfied: rsa<=3.5.0,>=3.1.2 in /silo/userspace/lib/python2.7/site-packages (from awscli)
Requirement already satisfied: s3transfer<0.2.0,>=0.1.12 in /silo/userspace/lib/python2.7/site-packages (from awscli)
Requirement already satisfied: PyYAML<=3.13,>=3.10 in /silo/userspace/lib/python2.7/site-packages (from awscli)
Requirement already satisfied: jmespath<1.0.0,>=0.7.1 in /usr/lib/python2.7/site-packages (from botocore==1.10.66->awscli)
Requirement already satisfied: python-dateutil<3.0.0,>=2.1 in /silo/userspace/lib/python2.7/site-packages (from botocore==1.10.66->awscli)
Requirement already satisfied: pyasn1>=0.1.3 in /silo/userspace/lib/python2.7/site-packages (from rsa<=3.5.0,>=3.1.2->awscli)
Requirement already satisfied: futures<4.0.0,>=2.2.0 in /silo/userspace/lib/python2.7/site-packages (from s3transfer<0.2.0,>=0.1.12->awscli)
Requirement already satisfied: six>=1.5 in /silo/userspace/lib/python2.7/site-packages (from python-dateutil<3.0.0,>=2.1->botocore==1.10.66->awscli)

ansible-playbook with digital_ocean module under ansible-silo doesn't see `dopy`

Problem Description

An Ansible module (digital_ocean) requires dopy >= 0.32; using ansible-silo --shell, pip does not seem to be installed. How to resolve the missing dependency?

Versions Used

$ ansible-silo --version
ansible-silo 1.3.3
ansible 2.4.0
ansible-lint 3.4.13
ansible installed on volume silo.jeffdickey
$

The "Ansible 2.4.0", of course, refers to the devel branch as covered in your --switch option documentation in the README.

Playbook Extract

The relevant bit of my playbook:

    - name: Verify that the specified Droplet is running
      # debug: { msg: "digital_ocean module fails on broken 'dopy >= 0.3.2' req" }
      digital_ocean:
        command: droplet
        name: '{{ ansible_hostname }}'
        unique_name: yes
        id: '{{ target_droplet }}'
        image_id: 'docker-16-04'
        region_id: 'sgp1'
        size_id: '512mb'
        private_networking: yes
        state: active
        ssh_key_ids: [9727406]
        api_token: '{{ do_token }}'

ansible-playbook Output

The output from running the playbook:

$ ansible-playbook -u jeff -i inventory playbook.yml --vault-password-file=./.vault-password -v
Identity added: /home/user/.ssh/id_rsa (/home/user/.ssh/id_rsa)
No config file found; using defaults

PLAY [Get a Docker image up and running on a new Droplet] **********************

TASK [Gathering Facts] *********************************************************
ok: [demo2]

TASK [Verify the presence of an SSH key at DO] *********************************
ok: [demo2] => {
    "msg": "SSH key would be verified"
}

TASK [Verify that the specified Droplet is running] ****************************
fatal: [demo2]: FAILED! => {"changed": false, "failed": true, "msg": "dopy >= 0.3.2 required for this module"}
	to retry, use: --limit @/home/user/playbooks/playbook.retry

PLAY RECAP *********************************************************************
demo2                      : ok=2    changed=0    unreachable=0    failed=1   

Help?

Ideas?

Odd Bundle Inconsistencies

Let me first start off saying again that I love what ansible-silo is doing, it is solving a need for my employer that I haven't been able to find anywhere else.

That being said, I encountered a really odd error yesterday and I can't seem to figure out what is going on.

I've built a bundle and it can run just fine on both Ubuntu 16.04 and Centos 7 machines, however when trying to execute on a RHEL 7 machine, I'm getting this error when trying to install it:

[bl839s@bld-apic-em-1 ~]$ docker run --interactive --tty --rm --volume ~/bin:/silo_install_path qosiga:0.0.14 --install
env: can't execute 'bash': No such file or directory

Showing the RedHat release on this server:

[bl839s@bld-apic-em-1 ~]$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.4 (Maipo)

However, on my development box which is running Centos 7, it works fine:

[bl839s@docker-node4 ~]$ docker run --interactive --tty --rm --volume ~/bin:/silo_install_path qosiga:0.0.14 --install
Installing from qosiga 0.0.14:
 - qosiga will be updated
Done
[bl839s@docker-node4 ~]$

Showing the Centos release on this server:

[bl839s@docker-node4 ~]$ cat /etc/centos-release
CentOS Linux release 7.4.1708 (Core)

Just for testing, I tried installing the plain ansible-silo on the RHEL7 machine and it worked fine:

[root@bld-apic-em-1 bl839s]# docker run --interactive --tty --rm --volume "/usr/local/bin:/silo_install_path" grpn/ansible-silo:2.1.0 --install
Unable to find image 'grpn/ansible-silo:2.1.0' locally
2.1.0: Pulling from grpn/ansible-silo
88286f41530e: Pull complete
3f37066d99ce: Pull complete
2315bb9a4578: Pull complete
dc833ec4b91e: Pull complete
3d6ccaeed476: Pull complete
e1a4e6af9c79: Pull complete
1d1a6cf92652: Pull complete
Digest: sha256:387139cd500cec4c0d5c396c5b1a0f86616427b71d0a1bde1241fcd3dbbc3ca8
Status: Downloaded newer image for grpn/ansible-silo:2.1.0
Installing from ansible-silo 2.1.0:
 - ansible will be created
 - ansible-config will be created
 - ansible-console will be created
 - ansible-doc will be created
 - ansible-galaxy will be created
 - ansible-lint will be created
 - ansible-playbook will be created
 - ansible-pull will be created
 - ansible-silo will be created
 - ansible-vault will be created
Done

Showing it runs just fine too:

[bl839s@bld-apic-em-1 silo]$ ansible-silo --version
ansible-silo 2.1.0
ansible 2.4.2.0
ansible-lint 3.4.20
ansible installed on volume silo.bl839s

This means that there is some inconsistency with the bundle I've built off of ansible-silo, and I'm wondering if you can give any pointers for where to look as to what could be causing this issue?

Any help you can provide would be appreciated.

Thanks again for all of the help given so far and I apologize for continuing to come back with problems, but hopefully it will just help ansible-silo become better in the process.

Slice of a second start-time

I've made a couple of container cli tools.. And I always found that 1 second container-boot-time to be very annoying. I have "fixed" this on my own projects by having a way to start the container in idle-mode.. ie, something like:

if [[ "${1}" == "--idle" ]]; then
  while true; do
    sleep 3600
  done
fi

then.. If the container is running, I can save that second by using docker exec instead of docker run.
Would that be something worth looking into for this project?

Some of the problems:

  • Can't mount current pwd

    • Normally, an ansible project is in the same directory, but if the ansible commands detect a changed pwd. They could recreate the container?
  • User looses control over what is running?

    • I ended up making the exec option into a helper, that can be controlled with mycommand-helper. Example mycommand-helper ps.. Also, to use this at all, you must first use mycommand-helper start..

Just throwing the idea out there :) Thanks for a great tool!

ansible-silo using --switch not functioning

First off, let me say that I'm really intrigued with this idea and project and can foresee this solving a lot of problems (which is probably what led to the development within Groupon's team).

That being said, I discovered ansbile-silo and watched the introduction video. As I was following along with the "video" I tried to use the --switch option received the following error:

$ ansible-silo --switch
fatal: protocol error: bad line length character:

Er
Failed to fetch!

I also tried to specifiy a "tag" of an ansible release and recieved the same error:

$ ansible-silo --switch v2.0.0.0-1
fatal: protocol error: bad line length character:

Er
Failed to fetch!

I'm fairly confident that my corporate firewall isn't blocking anything as I was able to install ansible-silo just fine and have had no other issues using docker images nor any issues with installing different versions of ansible itself.

There is no "template" for issues so I'm going to try and include all of the relevant information that might be needed to reproduce the issue, however, if I miss a detail, please let me know and I'll be happy to provide that information.

My envrionment:

$ cat /etc/issue
Ubuntu 16.04.3 LTS \n \l

$ ansible-silo --version
ansible-silo 1.3.3
ansible 2.3.1.0
ansible-lint 3.4.13

$ docker --version
Docker version 17.05.0-ce, build 89658be

$ docker image ls | grep silo
grpn/ansible-silo                       1.3.3               4333c8dc536b        2 weeks ago         233MB
grpn/ansible-silo                       latest              4333c8dc536b        2 weeks ago         233MB

Again, thanks for releasing this as open-source, it definitely has great potential!

Unable to install on Ubuntu 16.10

Hi, when running the installation commands you provide, I get the following error message:

docker run --interactive --tty --rm --volume "/usr/local/bin:/silo_install_path" grpn/ansible-silo:2.1.0 --install
Installing from ansible-silo 2.1.0:

  • ansible will be created
    cp: can't create symlink '/silo_install_path/ansible': Read-only file system
  • ansible-config will be created
    cp: can't create symlink '/silo_install_path/ansible-config': Read-only file system
  • ansible-console will be created
    cp: can't create symlink '/silo_install_path/ansible-console': Read-only file system
  • ansible-doc will be created
    cp: can't create symlink '/silo_install_path/ansible-doc': Read-only file system
  • ansible-galaxy will be created
    cp: can't create symlink '/silo_install_path/ansible-galaxy': Read-only file system
  • ansible-lint will be created
    cp: can't create symlink '/silo_install_path/ansible-lint': Read-only file system
  • ansible-playbook will be created
    cp: can't create symlink '/silo_install_path/ansible-playbook': Read-only file system
  • ansible-pull will be created
    cp: can't create symlink '/silo_install_path/ansible-pull': Read-only file system
  • ansible-silo will be created
    /silo/silo_functions.sh: line 447: /silo_install_path/ansible-silo: Read-only file system
    chmod: /silo_install_path/ansible-silo: No such file or directory
  • ansible-vault will be created
    cp: can't create symlink '/silo_install_path/ansible-vault': Read-only file system
    Done

Do you have an idea what I'm missing? Is the problem my read/write access to "/usr/local/bin:/silo_install_path" ?

Enforce Ansible version within container

Looking at using this as a tool internally to guarantee that all of our sysops have the same ansible env no matter what else they are running in their environment

I'm trying to figure out a way to ensure they are all running the same version of ansible (and preferably let me change that ansible version with a change to the silo configuration without them having to interact with it.

I can't see a way to do this presently and was wondering if it was possible at all?

Move to python3

Python 2 is EOL January 1st, 2020. The base image should have python 3

Tests fail when ~/.ssh/known_hosts does not exist

The ~/.ssh directory is mounted into the silo container when executed.

To be able to modify the config, all files will be symlinked from the mounted location into ~/.ssh, except the config file which instead is copied. This ensures the config file is not modified on the host, only inside the container.

As a result of this, if ssh creates ~/.ssh/known_hosts, it is creating it only inside the container and all modifications won't persist.

This results in failing tests. During tests we run the docker.yml playbook twice. Once to setup a docker container and accepting its ssh key. Another time to run the playbook against the docker container. On the 2nd run the ssh key is unknown since the entry in the known_hosts file did not persist, resulting in a failing playbook.

How to create files from bundle on local filesystem?

Sorry for the continuous questions.
It seems that as soon as you fix one problem for me, I come back with additional questions or issues. ๐Ÿ˜„

Question 1...

I've got some existing playbooks that create text files with the assemble module. When running them outside of "bundle" I created with ansible-silo, those files are stored in a specific directory which I can access later or re-run the playbook and the output from Ansible shows that there were not changes in the PLAY RECAP (as seen here):

PLAY RECAP ***************************************************************************
btv-vba-a                  : ok=28   changed=0    unreachable=0    failed=0

However, when I run the "bundle" version of my playbooks, I get that changes were made no matter how many times the PB is run:

PLAY RECAP ***************************************************************************
btv-vba-a                  : ok=28   changed=6    unreachable=0    failed=0

I have a feeling that this is due to the fact that the files are created and then wiped for each run. Is there a way I can define where those files are stored so as to make the playbooks idempotent?

Question 2...

In the same scenario, I've got a dynamic inventory script that is feeding Ansible information necessary for my PB's operation. When using the PBs in "bundle" mode, it works fine when I specify the inventory to use with the -i flag (the "bundle" I created is named qos_mgmt):

$ qos_mgmt -i netbox.py gen_qos.yml -l btv-vba-a

However, in this circumstance, I never use anything but that inventory file (netbox.py). When running the playbooks. Is there a way to specify which inventory to use by default so as to not have to always use the -i flag?

As always, I appreciate all of the work and effort put into the project and am finding very useful in what I need to do.

PS - I know that I worked with you previously and you had mentioned being on the Slack channel NetworkToCode, but I can't seem to recall your name or handle. Would you mind sharing that publicly?

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.