From 5de8818efb9e929cf804099309c31a33ba85a30a Mon Sep 17 00:00:00 2001 From: Dmitry Shulyak Date: Wed, 11 Nov 2015 20:37:29 +0200 Subject: [PATCH] Add additional packages and config for container --- Dockerfile | 3 +++ docker-compose.yml | 3 ++- f2s/resources/role_data/managers/from_nailgun.py | 2 +- f2s/resources/role_data/managers/globals.pp | 4 ++-- f2s/resources/role_data/managers/globals.py | 1 + f2s/vrs/fuel_node.yaml | 2 ++ run.sh | 2 +- 7 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1202cd57..cc0c548e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,5 +23,8 @@ RUN ansible-playbook -v -i "localhost," -c local /celery.yaml --tags install RUN pip install riak peewee RUN pip install -U setuptools>=17.1 RUN pip install -U python-fuelclient +RUN apt-get install -y puppet +RUN gem install hiera +RUN mkdir -p /etc/puppet/hieradata/ CMD ["/run.sh"] diff --git a/docker-compose.yml b/docker-compose.yml index 61f5b467..fa471b3f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -21,7 +21,8 @@ solar: # docker run --name solar -d -v /root/solar/solar:/solar -v /root/solar/solard:/solard -v /root/solar/templates:/vagrant/templates \ # -v /root/solar/resources:/vagrant/resources -v /root/solar/f2s:/vagrant/f2s \ -# -v /var/lib/fuel:/var/lib/fuel -v /root/.config/fuel/fuel_client.yaml:/root/.config/fuel/fuel_client.yaml \ +# -v /var/lib/fuel:/var/lib/fuel -v /root/.config/fuel/fuel_client.yaml:/etc/fuel/client/config.yaml -v /etc/puppet/modules:/etc/puppet/modules \ +# -v /root/.ssh:/root/.ssh \ # --link=riak:riak --link=redis:redis --name solar solarproject/solar-celery:f2s riak: diff --git a/f2s/resources/role_data/managers/from_nailgun.py b/f2s/resources/role_data/managers/from_nailgun.py index be2eb526..507ec0d1 100755 --- a/f2s/resources/role_data/managers/from_nailgun.py +++ b/f2s/resources/role_data/managers/from_nailgun.py @@ -10,4 +10,4 @@ ARGS = json.loads(sys.stdin.read()) env = Environment(ARGS['env']) facts = env.get_default_facts('deployment', [ARGS['uid']]) -sys.stdout.write(json.dumps(facts)) +sys.stdout.write(json.dumps(facts[0])) diff --git a/f2s/resources/role_data/managers/globals.pp b/f2s/resources/role_data/managers/globals.pp index c9bdf906..8d1de5a3 100644 --- a/f2s/resources/role_data/managers/globals.pp +++ b/f2s/resources/role_data/managers/globals.pp @@ -1,8 +1,8 @@ notice('MODULAR: globals.pp') $service_token_off = false - -$globals_yaml_file = "/etc/puppet/${uid}globals.yaml" +$identity = hiera('uid') +$globals_yaml_file = "/etc/puppet/${identity}globals.yaml" # remove cached globals values before anything else remove_file($globals_yaml_file) diff --git a/f2s/resources/role_data/managers/globals.py b/f2s/resources/role_data/managers/globals.py index b9c34dee..7e7da6f5 100755 --- a/f2s/resources/role_data/managers/globals.py +++ b/f2s/resources/role_data/managers/globals.py @@ -47,6 +47,7 @@ def collect_results(): def main(): prepare_hiera() + run_command() rst = collect_results() sys.stdout.write(json.dumps(rst)) diff --git a/f2s/vrs/fuel_node.yaml b/f2s/vrs/fuel_node.yaml index 1f54c360..1ea6185a 100644 --- a/f2s/vrs/fuel_node.yaml +++ b/f2s/vrs/fuel_node.yaml @@ -4,9 +4,11 @@ resources: from: resources/transport_ssh values: ssh_user: 'root' + ssh_key: '/root/.ssh/id_rsa' - id: transports{{index}} from: resources/transports values: + transports:key: ssh_transport{{index}}::ssh_key transports:user: ssh_transport{{index}}::ssh_user transports:port: ssh_transport{{index}}::ssh_port transports:name: ssh_transport{{index}}::name diff --git a/run.sh b/run.sh index e5def136..1d1f3cf7 100755 --- a/run.sh +++ b/run.sh @@ -6,6 +6,6 @@ if [ -d /solar ]; then fi #used only to start celery on docker -ansible-playbook -v -i "localhost," -c local /celery.yaml --skip-tags slave +ansible-playbook -v -i "localhost," -c local /celery.yaml --skip-tags slave,stop tail -f /var/run/celery/*.log