$ mkdir -p repositories/python && cd repositories/python $ git clone[email protected]:openstack/nova-docker.git && cd nova-docker # project was removed, have to checkout to the previous commit of the last master head $ git checkout HEAD^1 $ git log commit 034a4842fc1ebba5912e02cff8cd197ae81eb0c3 (HEAD, origin/stable/ocata) $ git checkout stable/mitaka
>> Build nova-docker
option one, build a python sdist tar file
1
setup.py sdist
An example of option one
1 2 3 4 5 6 7
$ python setup.py sdist $ tree dist dist └── nova-docker-0.0.1.dev275.tar.gz
# easy_install instead of pip to install this source dist tar file will do the job $ easy_install dist/nova-docker-0.0.1.dev275.tar.gz
To ensure this package being built during fpb --build nova-docker we should do this via pre_build_hook
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#!/bin/bash
# Add here any the actions which are required before plugin build # like packages building, packages downloading from mirrors and so on. # The script should return 0 if there were no errors. cd repositories/python git submodule update --init --recursive cd nova-docker; git checkout stable/mitaka; cd .. fpm -v "1:0.0.1" -s python \ -t deb \ -n fuel-plugin-nova-docker \ --python-install-bin /usr/bin \ --python-install-lib /usr/lib/python2.7/dist-packages/ \ nova-docker/setup.py mv *.deb ../ubuntu
Verify it via a plugin build.
1 2 3 4 5
$ ~ fpb --build nova_docker Plugin is built $ ~ cd nova_docker $ nova_docker git:(master) ls repositories/ubuntu fuel-plugin-nova-docker_1:0.0.1_all.deb
Let’s exclude the nova-docker binary file from the repository.
Save it as install.pp , let’s verify it like this:
1 2 3 4 5 6
root@node-1:~# puppet apply --debug ./install.pp Error: Could not find command'usermod' Error: /Stage[main]/Main/Exec[add nova to docker group]/returns: change from notrun to 0 failed: Could not find command'usermod'
root@node-1:~# which usermod /usr/sbin/usermod
Then we come to know path need to be put with /usr/sbin.
Then it could be done like below, where roles_include is a function from fuel-library on ruby function : library/deployment/puppet/osnailyfacter/spec/functions/roles_include_spec.rb (source code –> url)
$ nova_docker git:(master) mkdir -p deployment_scripts/puppet/manifests $ nova_docker git:(master) tree deployment_scripts deployment_scripts ├── deploy.sh # dummy script from the fpb template └── puppet # we create puppet files here └── manifests
The scripts were called via tasks in deployment_tasks.yml in the whole graph.
>> Entry for nova_docker-install
Let’s compse the deployment_tasks.yml, where we would like our install.pp being called during post_deployment on role: compute:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
# If you do not want to use task-based deployment that is introduced as experimental # in fuel v8.0 comment code section below this comment, uncomment two lines below it # and do the same for tasks below.
2019-01-20 14:56:02 +0000 Puppet (err): Could not run: Could not find file puppet/manifests/install.pp /usr/lib/ruby/vendor_ruby/puppet/application/apply.rb:179:in `main' /usr/lib/ruby/vendor_ruby/puppet/application/apply.rb:159:in `run_command' -- 2019-01-20 14:56:04 +0000 Puppet (err): Could not run: Could not find file puppet/manifests/install.pp /usr/lib/ruby/vendor_ruby/puppet/application/apply.rb:179:in `main' /usr/lib/ruby/vendor_ruby/puppet/application/apply.rb:159:in `run_command'
# not always working yum -y reinstall --disablerepo='*' /var/www/nailgun/<path>/fuel-plugins/plugin_foo.rpm yum -y install --disablerepo='*' /var/www/nailgun/<path>/fuel-plugins/plugin_foo.rpm # obvirously you could do so rpm -i /var/www/nailgun/<path>/fuel-plugins/plugin_foo.rpm --force [root@fuel ~]# fuel plugins --sync
// or sanity test only without actually executing changes with --noop [node-0]# puppet apply --debug --noop \ --modulepath=puppet/modules:/etc/puppet/modules:<path_plugin_bar-1.0>/puppet/modules \ puppet/manifests/plugin_foo_task_01.pp
task order debugging
The deployment process is a graph.
1 2 3 4 5 6 7
[root@fuel ~]# grep ".dot" /var/log/astute/astute.log :graph_dot_dir: /var/lib/astute/graphs :graph_dot_dir: /var/lib/astute/graphs 2019-01-18 03:33:46 INFO [26377] Check graph into file /var/lib/astute/graphs/graph-7395c5dc-bd42-40ab-9367-9ec5dc29ff05.dot # or generate yourself