Git Product home page Git Product logo

ansible-coreos-bootstrap's Introduction

This project is no longer maintained

coreos-bootstrap

In order to effectively run ansible, the target machine needs to have a python interpreter. Coreos machines are minimal and do not ship with any version of python. To get around this limitation we can install pypy, a lightweight python interpreter. The coreos-bootstrap role will install pypy for us and we will update our inventory file to use the installed python interpreter.

install

ansible-galaxy install defunctzombie.coreos-bootstrap

Configure your project

Unlike a typical role, you need to configure Ansible to use an alternative python interpreter for coreos hosts. This can be done by adding a coreos group to your inventory file and setting the group's vars to use the new python interpreter. This way, you can use ansible to manage CoreOS and non-CoreOS hosts. Simply put every host that has CoreOS into the coreos inventory group and it will automatically use the specified python interpreter.

[coreos]
host-01
host-02

[coreos:vars]
ansible_ssh_user=core
ansible_python_interpreter=/home/core/bin/python

This will configure ansible to use the python interpreter at /home/core/bin/python which will be created by the coreos-bootstrap role.

Bootstrap Playbook

Now you can simply add the following to your playbook file and include it in your site.yml so that it runs on all hosts in the coreos group.

- hosts: coreos
  gather_facts: False
  roles:
    - defunctzombie.coreos-bootstrap

Make sure that gather_facts is set to false, otherwise ansible will try to first gather system facts using python which is not yet installed!

Example Playbook

After bootstrap, you can use ansible as usual to manage system services, install python modules (via pip), and run containers. Below is a basic example that starts the etcd service, installs the docker-py module and then uses the ansible docker module to pull and start a basic nginx container.

- name: Nginx Example
  hosts: web
  sudo: true
  tasks:
    - name: Start etcd
      service: name=etcd.service state=started

    - name: Install docker-py
      pip: name=docker-py

    - name: pull container
      raw: docker pull nginx:1.7.1

    - name: launch nginx container
      docker:
        image="nginx:1.7.1"
        name="example-nginx"
        ports="8080:80"
        state=running

License

MIT

ansible-coreos-bootstrap's People

Contributors

defunctzombie avatar donbeave avatar johnallen3d avatar neil-mewe avatar sergeyzh avatar slezhuk avatar switchboardop avatar temoto 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

ansible-coreos-bootstrap's Issues

ssl library problem

seems like there is a problem bootstraping EC2 coreOS AMI with this playbook (using the last AMI from coreos site) , I am getting the following error

2014-10-27 01:17:25 (43.3 MB/s) - `pypy-2.4.0-linux64.tar.bz2' saved [14056378/14056378]

/root/pypy/bin/pypy: error while loading shared libraries: libssl.so.1.0.0: cannot open shared object file: No such file or directory

Using sudo in subsequent modules after bootstrap doesn't work if you didn't use sudo to bootstrap

following the README.md I didn't use sudo to install the bootstrap and everything was created (pypy, bin) in the /home/core directory. On subsequent calls, I followed the README and used sudo to install docker-py with pip. This caused a problem because the /home/core/bin/pip file uses $HOME in the paths and when I used sudo it looked for those files in the /root directory.

I am using cores 557.2.0 image for openstack (latest I found on their website)

General design is not very "ansible like"

Hi everyone,

I feel like the general design of the role is not following the normal "ansible way" if there is something like this. What do I mean by this? Checking if something is installed by running into an error is uncommon. Normally in ansible you just specify the desired state and ansible checks if any changes have to be run. Using the standard ansible plugins instead of shell plugins is also recommended wherever possible. I don't how big of a rewrite this would mean for this extension (did not yet look at the code), just wanted to bring up this issue and start a discussion.

Regards,

Tobi

bootstrap.sh fails to complete:" /lib64/libssl.so.1.0.0: no version information available" errors

When executing an Ansible playbook using the 'role' defunctzombie.coreos-bootstrap, the task which runs the bootstrap.ah script always fails with the message "/lib64/libssl.so.1.0.0: no version information available (required by /home/jmontes/pypy/bin/libpypy-c.so)"

Ansible workstation: Centos 6.8, Ansible 2.1.10
Remote system CoreOS version: 835.11.0 (One of my CoreOS systems at 1122.2.0 does not fail)

Playbook example:

  • hosts: coreos
    gather_facts: False
    roles:
    • defunctzombie.coreos-bootstrap

Host file variables example
[coreos:vars]
ansible_ssh_user=jmontes

ansible_python_interpreter="PATH=/home/jmontes/bin:$PATH python"

ansible_python_interpreter=/home/jmontes/bin/python

Sample Error message when manually running the bootstrap script (cleaner output compare to ansible output)
jmontes@coreos01 ~ $ ./bootstrap.sh
--2016-09-11 17:31:32-- https://bitbucket.org/pypy/pypy/downloads/pypy-5.1.0-linux64.tar.bz2
Resolving bitbucket.org... 104.192.143.1, 104.192.143.2, 104.192.143.3, ...
Connecting to bitbucket.org|104.192.143.1|:443... connected.
HTTP request sent, awaiting response... 302 FOUND
Location: https://bbuseruploads.s3.amazonaws.com/54220cd1-b139-4188-9455-1e13e663f1ac/downloads/b4819e39-76fe-4453-8315-9d76fcbec5a2/pypy-5.1.0-linux64.tar.bz2?Signature=pMuXVJ1xtSYaEsOZvBUWbAAQ7lg%3D&Expires=1473615171&AWSAccessKeyId=AKIAIWY5XSVPZPDQYRQQ&versionId=rbOyQ3EO5dhbTuz.gl60O6iXfntn7QM1&response-content-disposition=attachment%3B%20filename%3D%22pypy-5.1.0-linux64.tar.bz2%22 [following]
--2016-09-11 17:31:33-- https://bbuseruploads.s3.amazonaws.com/54220cd1-b139-4188-9455-1e13e663f1ac/downloads/b4819e39-76fe-4453-8315-9d76fcbec5a2/pypy-5.1.0-linux64.tar.bz2?Signature=pMuXVJ1xtSYaEsOZvBUWbAAQ7lg%3D&Expires=1473615171&AWSAccessKeyId=AKIAIWY5XSVPZPDQYRQQ&versionId=rbOyQ3EO5dhbTuz.gl60O6iXfntn7QM1&response-content-disposition=attachment%3B%20filename%3D%22pypy-5.1.0-linux64.tar.bz2%22
Resolving bbuseruploads.s3.amazonaws.com... 54.231.48.152
Connecting to bbuseruploads.s3.amazonaws.com|54.231.48.152|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 23264958 (22M) [application/x-tar]
Saving to: 'STDOUT'

  •                                    100%[==================================================================================>]  22.19M  4.55MB/s   in 5.3s  
    

2016-09-11 17:31:39 (4.16 MB/s) - written to stdout [23264958/23264958]

/home/jmontes/pypy/bin/pypy: /lib64/libssl.so.1.0.0: no version information available (required by /home/jmontes/pypy/bin/libpypy-c.so)
/home/jmontes/pypy/bin/pypy: /lib64/libssl.so.1.0.0: no version information available (required by /home/jmontes/pypy/bin/libpypy-c.so)
/home/jmontes/pypy/bin/pypy: /lib64/libcrypto.so.1.0.0: no version information available (required by /home/jmontes/pypy/bin/libpypy-c.so)
/home/jmontes/pypy/bin/pypy: relocation error: /home/jmontes/pypy/bin/libpypy-c.so: symbol EC_KEY_free, version OPENSSL_1.0.0 not defined in file libcrypto.so.1.0.0 with link time reference

Issues starting services with Ansible

I can't seem to get any services started using this approach. Playbook:

- hosts: web
  remote_user: core
  tasks:

  - name: start etcd
    service: name=etcd.service state=started

Result:

coreos-web-01 | FAILED => failed to parse: Spawning container core-crsmithdev_ubuntu-latest on /var/lib/toolbox/core-crsmithdev_ubuntu-latest.
Press ^] three times within 1s to kill container.
{"msg": "service not found: etcd.service", "failed": true}

Container core-crsmithdev_ubuntu-latest failed with error code 1.

I can systemctl start etcd.service with no issues manually, however.

Any idea what might be going on?

msg: Aborting, target uses selinux but python bindings (libselinux-python) aren't installed!

With current CoreOS Alpha (779.0.0):

TASK: [defunctzombie.coreos-bootstrap | Copy get-pip.py] **********************
failed: [etcd] => {"checksum": "6aa4ab7873ad21e4316f0deadbbc794c5a46e93c", "failed": true}
msg: Aborting, target uses selinux but python bindings (libselinux-python) aren't installed!
failed: [node-001] => {"checksum": "6aa4ab7873ad21e4316f0deadbbc794c5a46e93c", "failed": true}
msg: Aborting, target uses selinux but python bindings (libselinux-python) aren't installed!
failed: [node-003] => {"checksum": "6aa4ab7873ad21e4316f0deadbbc794c5a46e93c", "failed": true}
msg: Aborting, target uses selinux but python bindings (libselinux-python) aren't installed!
failed: [master] => {"checksum": "6aa4ab7873ad21e4316f0deadbbc794c5a46e93c", "failed": true}
msg: Aborting, target uses selinux but python bindings (libselinux-python) aren't installed!

FATAL: all hosts have already failed -- aborting

Also: coreos/bugs#449

Alternative to use

As this project is not maintained anymore, you're welcome to use its fork by our team.

We've switched to portable PyPy version of 6.0.0 which should resolve the recent issues with installation (like #14, #36, #39, #46), and we're going to support and evolve this fork. We would love to see contributions.

We will publish our fork to the official Ansible Galaxy under the name of instrumentisto.coreos-bootstrap as soon as it will be possible.

Bootstrapping ec2 dynamic inventory

I'm trying to bootstrap ec2 instances with this script. I'm using ansible's ec2.py and ec2.ini file.

ec2.ini

# Ansible EC2 external inventory script settings
#

[ec2]

# to talk to a private eucalyptus instance uncomment these lines
# and edit edit eucalyptus_host to be the host name of your cloud controller
#eucalyptus = True
#eucalyptus_host = clc.cloud.domain.org

# AWS regions to make calls to. Set this to 'all' to make request to all regions
# in AWS and merge the results together. Alternatively, set this to a comma
# separated list of regions. E.g. 'us-east-1,us-west-1,us-west-2'
regions = us-west-2
regions_exclude = us-gov-west-1,cn-north-1

# When generating inventory, Ansible needs to know how to address a server.
# Each EC2 instance has a lot of variables associated with it. Here is the list:
#   http://docs.pythonboto.org/en/latest/ref/ec2.html#module-boto.ec2.instance
# Below are 2 variables that are used as the address of a server:
#   - destination_variable
#   - vpc_destination_variable

# This is the normal destination variable to use. If you are running Ansible
# from outside EC2, then 'public_dns_name' makes the most sense. If you are
# running Ansible from within EC2, then perhaps you want to use the internal
# address, and should set this to 'private_dns_name'. The key of an EC2 tag
# may optionally be used; however the boto instance variables hold precedence
# in the event of a collision.
destination_variable = private_dns_name

# This allows you to override the inventory_name with an ec2 variable, instead
# of using the destination_variable above. Addressing (aka ansible_ssh_host)
# will still use destination_variable. Tags should be written as 'tag_TAGNAME'.
#hostname_variable = tag_Name

# For server inside a VPC, using DNS names may not make sense. When an instance
# has 'subnet_id' set, this variable is used. If the subnet is public, setting
# this to 'ip_address' will return the public IP address. For instances in a
# private subnet, this should be set to 'private_ip_address', and Ansible must
# be run from within EC2. The key of an EC2 tag may optionally be used; however
# the boto instance variables hold precedence in the event of a collision.
# WARNING: - instances that are in the private vpc, _without_ public ip address
# will not be listed in the inventory until You set:
# vpc_destination_variable = private_ip_address
vpc_destination_variable = private_ip_address

# The following two settings allow flexible ansible host naming based on a
# python format string and a comma-separated list of ec2 tags.  Note that:
#
#1) If the tags referenced are not present for some instances, empty strings
#    will be substituted in the format string.
#2) This overrides both destination_variable and vpc_destination_variable.
#
#destination_format = {0}.{1}.example.com
#destination_format_tags = Name,environment

# To tag instances on EC2 with the resource records that point to them from
# Route53, uncomment and set 'route53' to True.
route53 = False

# To exclude RDS instances from the inventory, uncomment and set to False.
#rds = False

# To exclude ElastiCache instances from the inventory, uncomment and set to False.
#elasticache = False

# Additionally, you can specify the list of zones to exclude looking up in
# 'route53_excluded_zones' as a comma-separated list.
# route53_excluded_zones = samplezone1.com, samplezone2.com

# By default, only EC2 instances in the 'running' state are returned. Set
# 'all_instances' to True to return all instances regardless of state.
all_instances = False

# By default, only EC2 instances in the 'running' state are returned. Specify
# EC2 instance states to return as a comma-separated list. This
# option is overriden when 'all_instances' is True.
# instance_states = pending, running, shutting-down, terminated, stopping, stopped

# By default, only RDS instances in the 'available' state are returned.  Set
# 'all_rds_instances' to True return all RDS instances regardless of state.
all_rds_instances = False

# By default, only ElastiCache clusters and nodes in the 'available' state
# are returned. Set 'all_elasticache_clusters' and/or 'all_elastic_nodes'
# to True return all ElastiCache clusters and nodes, regardless of state.
#
# Note that all_elasticache_nodes only applies to listed clusters. That means
# if you set all_elastic_clusters to false, no node will be return from
# unavailable clusters, regardless of the state and to what you set for
# all_elasticache_nodes.
all_elasticache_replication_groups = False
all_elasticache_clusters = False
all_elasticache_nodes = False

# API calls to EC2 are slow. For this reason, we cache the results of an API
# call. Set this to the path you want cache files to be written to. Two files
# will be written to this directory:
#   - ansible-ec2.cache
#   - ansible-ec2.index
cache_path = ~/.ansible/tmp

# The number of seconds a cache file is considered valid. After this many
# seconds, a new API call will be made, and the cache file will be updated.
# To disable the cache, set this value to 0
cache_max_age = 300

# Organize groups into a nested/hierarchy instead of a flat namespace.
nested_groups = False

# Replace - tags when creating groups to avoid issues with ansible
replace_dash_in_groups = True

# If set to true, any tag of the form "a,b,c" is expanded into a list
# and the results are used to create additional tag_* inventory groups.
expand_csv_tags = False

# The EC2 inventory output can become very large. To manage its size,
# configure which groups should be created.
group_by_instance_id = True
group_by_region = True
group_by_availability_zone = True
group_by_ami_id = True
group_by_instance_type = True
group_by_key_pair = True
group_by_vpc_id = True
group_by_security_group = True
group_by_tag_keys = True
group_by_tag_none = True
group_by_route53_names = True
group_by_rds_engine = True
group_by_rds_parameter_group = True
group_by_elasticache_engine = True
group_by_elasticache_cluster = True
group_by_elasticache_parameter_group = True
group_by_elasticache_replication_group = True

# If you only want to include hosts that match a certain regular expression
# pattern_include = staging-*

# If you want to exclude any hosts that match a certain regular expression
# pattern_exclude = staging-*

# Instance filters can be used to control which instances are retrieved for
# inventory. For the full list of possible filters, please read the EC2 API
# docs: http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeInstances.html#query-DescribeInstances-filters
# Filters are key/value pairs separated by '=', to list multiple filters use
# a list separated by commas. See examples below.

# Retrieve only instances with (key=value) env=staging tag
# instance_filters = tag:env=staging

# Retrieve only instances with role=webservers OR role=dbservers tag
# instance_filters = tag:role=webservers,tag:role=dbservers

# Retrieve only t1.micro instances OR instances with tag env=staging
# instance_filters = instance-type=t1.micro,tag:env=staging

# You can use wildcards in filter values also. Below will list instances which
# tag Name value matches webservers1*
# (ex. webservers15, webservers1a, webservers123 etc)
# instance_filters = tag:Name=webservers1*

# A boto configuration profile may be used to separate out credentials
# see http://boto.readthedocs.org/en/latest/boto_config_tut.html
# boto_profile = some-boto-profile-name

instance_filters = tag:ResourceGroup=ansible

[ec2:vars]
ansible_ssh_user=core
ansible_python_interpreter="PATH=/home/core/bin:$PATH python"

Here's the output of my command...

ameissner@coreos-ansible-example $ ansible -i /etc/ansible/ec2.py -m ping ec2
10_0_5_5 | FAILED! => {
    "changed": false, 
    "failed": true, 
    "module_stderr": "", 
    "module_stdout": "/bin/sh: /usr/bin/python: No such file or directory\r\n", 
    "msg": "MODULE FAILURE", 
    "parsed": false
}
ameissner@coreos-ansible-example $ ansible-playbook bootstrap.yml -i /etc/ansible/ec2.py

PLAY [bootstrap coreos hosts] **************************************************

TASK [defunctzombie.coreos-bootstrap : Check if bootstrap is needed] ***********
fatal: [10_0_5_5]: FAILED! => {"changed": false, "failed": true, "rc": 1, "stderr": "", "stdout": "stat: cannot stat '/home/core/.bootstrapped': No such file or directory\r\n", "stdout_lines": ["stat: cannot stat '/home/core/.bootstrapped': No such file or directory"]}
...ignoring

TASK [defunctzombie.coreos-bootstrap : Run bootstrap.sh] ***********************
changed: [10_0_5_5]

TASK [defunctzombie.coreos-bootstrap : Check if we need to install pip] ********
fatal: [10_0_5_5]: FAILED! => {"failed": true, "msg": "'ansible_python_interpreter' is undefined"}
...ignoring

TASK [defunctzombie.coreos-bootstrap : Copy get-pip.py] ************************
fatal: [10_0_5_5]: FAILED! => {"changed": false, "checksum": "6aa4ab7873ad21e4316f0deadbbc794c5a46e93c", "failed": true, "module_stderr": "", "module_stdout": "/bin/sh: /usr/bin/python: No such file or directory\r\n", "msg": "MODULE FAILURE", "parsed": false}

NO MORE HOSTS LEFT *************************************************************
    to retry, use: --limit @bootstrap.retry

PLAY RECAP *********************************************************************
10_0_5_5                   : ok=3    changed=1    unreachable=0    failed=1   

Any help would be greatly appreciated!

Problem run the playbook websit.yml

Hi,
I go the following error when running ansible-playbook -i inventory/vagrant website.yml.

The step to install docker-py and pull the container imagess seem successful. It failed at launching the container. Can anyone help? Thanks.

My coreos version is VERSION=647.2.0

TASK: [pull container] ********************************************************
ok: [core-02]
ok: [core-01]

TASK: [launch nginx container] ************************************************
failed: [core-01] => {"failed": true, "parsed": false}
invalid output was: /home/core/pypy/bin/pypy: /lib64/libssl.so.1.0.0: no version information available (required by /home/core/pypy/bin/pypy)
/home/core/pypy/bin/pypy: /lib64/libcrypto.so.1.0.0: no version information available (required by /home/core/pypy/bin/pypy)
Traceback (most recent call last):
File "app_main.py", line 75, in run_toplevel
File "/home/core/.ansible/tmp/ansible-tmp-1435675179.7-61095459323454/docker", line 1813, in
main()
File "/home/core/.ansible/tmp/ansible-tmp-1435675179.7-61095459323454/docker", line 709, in main
except docker.client.APIError, e:
AttributeError: 'module' object has no attribute 'APIError'

failed: [core-02] => {"failed": true, "parsed": false}
invalid output was: /home/core/pypy/bin/pypy: /lib64/libssl.so.1.0.0: no version information available (required by /home/core/pypy/bin/pypy)
/home/core/pypy/bin/pypy: /lib64/libcrypto.so.1.0.0: no version information available (required by /home/core/pypy/bin/pypy)
Traceback (most recent call last):
File "app_main.py", line 75, in run_toplevel
File "/home/core/.ansible/tmp/ansible-tmp-1435675179.7-172731872346784/docker", line 1813, in
main()
File "/home/core/.ansible/tmp/ansible-tmp-1435675179.7-172731872346784/docker", line 709, in main
except docker.client.APIError, e:
AttributeError: 'module' object has no attribute 'APIError'

FATAL: all hosts have already failed -- aborting

pip-install: libssl and libcrypto throw errors

Hi all,

first of all, thanks for that role!!

I tried using it with a current vagrant box with core-OS (CoreOS 472.0.0) from: http://alpha.release.core-os.net/amd64-usr/472.0.0/coreos_production_vagrant.box and it works, but apparently it has issues with pip. All else installs fine.

Here is the error message:
TASK: [defunctzombie.coreos-bootstrap | Check if we need to install pip] ******
failed: [core-01] => {"changed": false, "cmd": "PATH=/home/core/bin:$PATH python -m pip --version", "delta": "0:00:00.061536", "end": "2014-10-23 22:44:39.162935", "rc": 1, "start": "2014-10-23 22:44:39.101399", "stdout_lines": []}
stderr: /home/core/pypy/bin/pypy: /lib64/libssl.so.1.0.0: no version information available (required by /home/core/pypy/bin/pypy)
/home/core/pypy/bin/pypy: /lib64/libcrypto.so.1.0.0: no version information available (required by /home/core/pypy/bin/pypy)
/home/core/pypy/bin/pypy: No module named pip

Thanks
Alex

Doesn't seem to work with ansible > 2.0

Bootstrapping on ansible 2.0 produces:

TASK [defunctzombie.coreos-bootstrap : Check if we need to install pip] ********
fatal: [master1]: FAILED! => {"changed": false, "cmd": "PATH=/home/brpxuser/bin:$PATH python -m pip --version", "delta": "0:00:00.186103", "end": "2016-05-27 10:36:57.051637", "failed": true, "rc": 1, "start": "2016-05-27 10:36:56.865534", "stderr": "/home/brpxuser/pypy/bin/pypy: /lib64/libssl.so.1.0.0: no version information available (required by /home/brpxuser/pypy/bin/pypy)\n/home/brpxuser/pypy/bin/pypy: /lib64/libcrypto.so.1.0.0: no version information available (required by /home/brpxuser/pypy/bin/pypy)\n/home/brpxuser/pypy/bin/pypy: No module named pip", "stdout": "", "stdout_lines": [], "warnings": []}
...ignoring

TASK [defunctzombie.coreos-bootstrap : Copy get-pip.py] ************************
changed: [master1]

While bootstrapping on ansible 2.1 and 2.2:

TASK [defunctzombie.coreos-bootstrap : Check if we need to install pip] ********
fatal: [master1]: FAILED! => {"changed": false, "failed": true, "module_stderr": "", "module_stdout": "/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)\r\n/home/brpxuser/pypy/bin/pypy: /lib64/libssl.so.1.0.0: no version information available (required by /home/brpxuser/pypy/bin/pypy)\r\n/home/brpxuser/pypy/bin/pypy: /lib64/libcrypto.so.1.0.0: no version information available (required by /home/brpxuser/pypy/bin/pypy)\r\n/bin/sh: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)\r\nTraceback (most recent call last):\r\n  File \"app_main.py\", line 75, in run_toplevel\r\n  File \"/home/brpxuser/.ansible/tmp/ansible-tmp-1464345101.58-266085877590530/command\", line 114, in <module>\r\n    exitcode = invoke_module(module, zipped_mod, ZIPLOADER_PARAMS)\r\n  File \"/home/brpxuser/.ansible/tmp/ansible-tmp-1464345101.58-266085877590530/command\", line 28, in invoke_module\r\n    p = subprocess.Popen(['PATH=/home/brpxuser/bin:$PATH python', module], env=os.environ, shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)\r\n  File \"/home/brpxuser/pypy/lib-python/2.7/subprocess.py\", line 710, in __init__\r\n    errread, errwrite)\r\n  File \"/home/brpxuser/pypy/lib-python/2.7/subprocess.py\", line 1331, in _execute_child\r\n    raise child_exception\r\nOSError: [Errno 2] No such file or directory\r\n", "msg": "MODULE FAILURE", "parsed": false}
...ignoring

TASK [defunctzombie.coreos-bootstrap : Copy get-pip.py] ************************
fatal: [master1]: FAILED! => {"failed": true, "msg": "Failed to get information on remote file (/home/brpxuser/get-pip.py): MODULE FAILURE"}

It seems the script stopped working on recent ansible versions. Are there plans to update it?

Problem with install docker-py missing libssl, libcrypto

core@ip-local ~ $ ./bin/pip install docker-py
/home/core/pypy/bin/pypy: /lib64/libssl.so.1.0.0: no version information available (required by /home/core/pypy/bin/pypy)
/home/core/pypy/bin/pypy: /lib64/libcrypto.so.1.0.0: no version information available (required by /home/core/pypy/bin/pypy)
Collecting docker-py
  Could not find any downloads that satisfy the requirement docker-py
  No distributions at all found for docker-py

but

ls /lib64/libssl.so* -l
lrwxrwxrwx 1 root root     15 Feb  5 02:53 /lib64/libssl.so -> libssl.so.1.0.0
-r-xr-xr-x 1 root root 454304 Feb  5 01:31 /lib64/libssl.so.1.0.0

Any idea how solve this problem?

Error: "python isn't present on the system. Unable to compute checksum"

I was using this role without any problems so far, but suddenly it stopped working. Probably it's not compatible with newer CoreOS versions.

When I try to execute the role I get the following error while trying to copy the get-pip file into the CoreOS machine: python isn't present on the system. Unable to compute checksum

I set the ansible_python_interpreter to /home/core/bin/python, but still the error shows up. Any clues?

How to get it running without using a specific Inventory file?

Hi,

I've found your module very useful. However, the one thing that is troubling me right now is how can I run this without using the inventory file ? I tried something like : role : rolename , ansible_python_interpreter="PATH=/home/core/bin:$PATH python" but it fails in the step where its trying to setup pip. Have you run it without an inventory file ? How do I do that?
Thanks.

getting python to work every login for ansible

The way the script is setup... does not make sense to me. You would have to run it in front of every playbook. What I was thinking (and I can give you the code, but here is the idea).

Run the traditional bootstrap.py, but this time at the end of the first playbook

  • delete /home/core/.bashrc (this is a symlink on coreOS, so now we can put a real bashrc)
  • cp /usr/share/skel/.bashrc . (this is where the symlink was from, we can now edit this copy)
  • add export PATH=$PATH:/home/core/bin to the end of the .bashrc file

Now every script from now on will be able to run the python that the original bootstrap.py could use. Want me to provide my code? Got this working....

CPython as option

Hi
I'm encountered an issue using coreos-bootstrap ansible/ansible#10157. It can be incompatibility between ansible and pypy. Is it possible to create option to use CPython?

error while loading shared libraries: libtinfo.so.5: cannot open shared object file

It seems that CoreOS probably removed something in the recent version.

core@mami ~ $ cat /etc/os-release 
NAME="Container Linux by CoreOS"
ID=coreos
VERSION=1353.4.0
VERSION_ID=1353.4.0
BUILD_ID=2017-03-31-0211
PRETTY_NAME="Container Linux by CoreOS 1353.4.0 (Ladybug)"
ANSI_COLOR="38;5;75"
HOME_URL="https://coreos.com/"
BUG_REPORT_URL="https://github.com/coreos/bugs/issues"
core@mami ~ $ ./pypy/bin/pip
/home/core/pypy/bin/pypy: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory

defunctzombie.coreos-bootstrap role fails during bootstrap.sh task: " /lib64/libssl.so.1.0.0: no version information available" errors

When executing an Ansible playbook using the 'role' defunctzombie.coreos-bootstrap, the task which runs the bootstrap.ah script always fails with the message "/lib64/libssl.so.1.0.0: no version information available (required by /home/jmontes/pypy/bin/libpypy-c.so)"

Ansible workstation: Centos 6.8, Ansible 2.1.10
Remote systems have CoreOS version: 835.11.0 (One of my CoreOS systems at 1122.2.0 does not fail like the others)

Playbook example:
hosts: coreos
gather_facts: False

roles:
defunctzombie.coreos-bootstrap

Host file variables example
[coreos:vars]
ansible_ssh_user=jmontes

ansible_python_interpreter="PATH=/home/jmontes/bin:$PATH python"

ansible_python_interpreter=/home/jmontes/bin/python

Sample Error message when manually running the bootstrap script (cleaner output compared to ansible output)
The same error occurs when Ansible executes the bootstrap script, but the text output is harder to read, the example below is just a manual execution of the same exact bash script.

jmontes@coreos01 ~ $ ./bootstrap.sh
--2016-09-11 17:31:32-- https://bitbucket.org/pypy/pypy/downloads/pypy-5.1.0-linux64.tar.bz2
Resolving bitbucket.org... 104.192.143.1, 104.192.143.2, 104.192.143.3, ...
Connecting to bitbucket.org|104.192.143.1|:443... connected.
HTTP request sent, awaiting response... 302 FOUND
Location: https://bbuseruploads.s3.amazonaws.com/54220cd1-b139-4188-9455-1e13e663f1ac/downloads/b4819e39-76fe-4453-8315-9d76fcbec5a2/pypy-5.1.0-linux64.tar.bz2?Signature=pMuXVJ1xtSYaEsOZvBUWbAAQ7lg%3D&Expires=1473615171&AWSAccessKeyId=AKIAIWY5XSVPZPDQYRQQ&versionId=rbOyQ3EO5dhbTuz.gl60O6iXfntn7QM1&response-content-disposition=attachment%3B%20filename%3D%22pypy-5.1.0-linux64.tar.bz2%22 [following]
--2016-09-11 17:31:33-- https://bbuseruploads.s3.amazonaws.com/54220cd1-b139-4188-9455-1e13e663f1ac/downloads/b4819e39-76fe-4453-8315-9d76fcbec5a2/pypy-5.1.0-linux64.tar.bz2?Signature=pMuXVJ1xtSYaEsOZvBUWbAAQ7lg%3D&Expires=1473615171&AWSAccessKeyId=AKIAIWY5XSVPZPDQYRQQ&versionId=rbOyQ3EO5dhbTuz.gl60O6iXfntn7QM1&response-content-disposition=attachment%3B%20filename%3D%22pypy-5.1.0-linux64.tar.bz2%22
Resolving bbuseruploads.s3.amazonaws.com... 54.231.48.152
Connecting to bbuseruploads.s3.amazonaws.com|54.231.48.152|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 23264958 (22M) [application/x-tar]
Saving to: 'STDOUT'

100%[==================================================================================>] 22.19M 4.55MB/s in 5.3s
2016-09-11 17:31:39 (4.16 MB/s) - written to stdout [23264958/23264958]

/home/jmontes/pypy/bin/pypy: /lib64/libssl.so.1.0.0: no version information available (required by /home/jmontes/pypy/bin/libpypy-c.so)
/home/jmontes/pypy/bin/pypy: /lib64/libssl.so.1.0.0: no version information available (required by /home/jmontes/pypy/bin/libpypy-c.so)
/home/jmontes/pypy/bin/pypy: /lib64/libcrypto.so.1.0.0: no version information available (required by /home/jmontes/pypy/bin/libpypy-c.so)
/home/jmontes/pypy/bin/pypy: relocation error: /home/jmontes/pypy/bin/libpypy-c.so: symbol EC_KEY_free, version OPENSSL_1.0.0 not defined in file libcrypto.so.1.0.0 with link time reference

check for re-bootstrapping

Some version changes are incompatible with old bootstrap attempts.

I can think of a couple ways to handle this, but I just wanted to lodge it as a concern.

Here's an example, this is the error from an old bootstrap and a new attempt to call python (but it's installed to a different location).

fatal: [10.10.10.10]: FAILED! => {"changed": false, "failed": true, "module_stderr": "Shared connection to 10.10.10.10 closed.\r\n", "module_stdout": "/home/core/pypy/bin/pypy: /lib64/libssl.so.1.0.0: no version information available (required by /home/core/pypy/bin/pypy)\r\n/home/core/pypy/bin/pypy: /lib64/libcrypto.so.1.0.0: no version information available (required by /home/core/pypy/bin/pypy)\r\nTraceback (most recent call last):\r\n  File \"app_main.py\", line 75, in run_toplevel\r\n  File \"/home/core/.ansible/tmp/ansible-tmp-1479847680.99-162471543187092/pip.py\", line 130, in <module>\r\n    exitcode = invoke_module(module, zipped_mod, ANSIBALLZ_PARAMS)\r\n  File \"/home/core/.ansible/tmp/ansible-tmp-1479847680.99-162471543187092/pip.py\", line 37, in invoke_module\r\n    p = subprocess.Popen(['PATH=/home/core/bin:$PATH', 'python', module], env=os.environ, shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)\r\n  File \"/home/core/pypy/lib-python/2.7/subprocess.py\", line 710, in __init__\r\n    errread, errwrite)\r\n  File \"/home/core/pypy/lib-python/2.7/subprocess.py\", line 1331, in _execute_child\r\n    raise child_exception\r\nOSError: [Errno 2] No such file or directory\r\n", "msg": "MODULE FAILURE"}

Getting "failed to download the file: HTTP Error 403: Forbidden" error on download

Hi team,

I've tried running the bootstrap.yml from a home network workstation, no issues
Tried the same from a work/office workstation and get a 403 forbidden error for one of the components. Has anyone seen this kind of error/issue before?
I'm able to do a manual wget of https://github.com/defunctzombie/ansible-coreos-bootstrap/archive/master.tar.gz, but ansible gets a 403 error.

Below is a -vvvv output

/ansible-work$ ansible-galaxy -vvvv install defunctzombie.coreos-bootstrap --ignore-errors
Using /etc/ansible/ansible.cfg as config file
Opened /home/jmontes/.ansible_galaxy
Validate TLS certificates: True
Connecting to galaxy_server: https://galaxy.ansible.com
Base API: https://galaxy.ansible.com/api/v1
Installing role defunctzombie.coreos-bootstrap
Opened /home/jmontes/.ansible_galaxy
Validate TLS certificates: True
Connecting to galaxy_server: https://galaxy.ansible.com
Base API: https://galaxy.ansible.com/api/v1

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.