bernardovale / ansible-role-db2 Goto Github PK
View Code? Open in Web Editor NEWAn ansible role for installing and manage IBM DB2 Database
An ansible role for installing and manage IBM DB2 Database
db2 module cant find the 'source' command on systems where dash is default. . Setting environment config setting executable does not help - see also ansible/ansible#1238
Database support changed several variables on the role. It is time to remake the documentation
Hi ,
we are using URL to load or else copying the file manually to target server. instead of both. is it possible to add task to copy the db2 software from ansible master server to db2 server (Where installation is planned).
if it's already there. please suggest what option need to be used.
Enhance code readability and make it more pythonic
Hey I think adding the possbility enter an alias for the database creation could benefit this role and is fairly easy to implement. The create_database Task would Need another db2 Attribute "alias". And the python script would just Need a few additions very similar to db.automatic.
Here are the docs: https://www.ibm.com/support/knowledgecenter/en/SSEPGG_10.5.0/com.ibm.db2.luw.admin.cmd.doc/doc/r0001941.html
I'm at work so I can't create a pull request but this would be an easy Feature to implement!
Response file should be configured as a template
db2 shoudn't be a folder.
Add support to uninstall db2
Should be possible to create multiples instances
If user is root the become_method
shoud be su
If not, the default become_method
is sudo
For example in docker environment it is better to have image that has correct software version
and on update it would only change software.
Simplification of error handling if something is wrong just on instance level creation...
Response files can be used for db2setup and for db2icrt and as such separation in my opinion should be done
for example use of this logic would be:
https://www.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.qb.server.doc/doc/c0056181.html
There is no support for check mode but inside the module it says that support.
Fix or remove the support.
After installing setup the license key.
- name: Create Databases for each instance
shell: "source /db2/{{item.instance}}/sqllib/db2profile; bash /tmp/{{item.instance}}_databases.cmd"
become: yes
become_user: "{{item.instance}}"
become_method: sudo
with_items: databases
register: su_value
Because I'm using databases
as the loop the item
doesn't contain the home_directory
of DB2. This should be fixed
Setup DB alias
Should be possible to customize the installation adding Global Profile Registry parameters
Should be possible to create multiples Databases
Hello again,
this time I noticed that the step "Validating the current installation" is not working. I don´t know why, but the command db2val is not producing any output. The validate step searches for the output 'DBI1335I' - which fails. The DB2 installation seems to be clean.
Of course one can skip the validation with the 'validate'-Tag. I´m using DB2 V10.5-FP7
Thanks,
Oliver
Hi,
I´m using your role with ansible-playbook v2.0.1.0. It fails at prerequisites check with message
fatal: [devvm-centos7]: FAILED! => {"failed": true, "msg": "The conditional check ''failed' in precheck.stderr' failed. The error was: error while evaluating conditional ('failed' in precheck.stderr): Unable to look up a name or access an attribute in template string. Make sure your variable name does not contain invalid characters like '-'."}
Do I have to setup a variable or is this just a syntax failure in "failed_when". I´m new to ansible so I´m not able to figure it out myself.
Thanks for the role!
Hello,
according to
ansible/ansible#23496 (comment)
with_items requires explicit jinja2 wrapping:
with_items: "{{ databases }}"
please fix it in tasks
We need this to test on EL.
Some tasks could be asyncronous, like db2 decompress and pre requisites packages.
The code above makes impossible to create a user on /db2/myuser
for example.
- name: Creating DB2 Instance Users
user:
name: "{{item.name}}"
group: "{{item.group_name}}"
password: ldUMKEu7/QCAY
home: "/home/{{item.name}}"
when: item.options is not defined or item.options.password is not defined
with_items: db2_instances
Setup variables to download DB2 if required
Should be idempotent, no matter how
Cannot set uid and gid for multiple instances.
This configuration would create three instances.
In this configuration we've set uid/gid manually for the first instance but not for the others.
The user creation task:
- name: Creating DB2 Instance Users - Custom home_dir
user:
name: "{{item.name}}"
group: "{{item.group_name}}"
password: "{{ item.password | default('ldUMKEu7/QCAY')}}"
home: "{{ item.home_directory }}"
gid: "{{ item.gid | default('543') }}"
uid: "{{ item.uid | default('544') }}"
with_items: "{{ db2_instances }}"
when: item.home_directory is defined
Would translate into this:
- name: Creating DB2 Instance Users - default
user:
name: "myinstan"
group: "myinadm"
password: "foo"
home: "/home/myinstan"
gid: 666
uid: 667
...
- name: Creating DB2 Instance Users - default
user:
name: "myinstan2"
group: "myinadm2"
password: "foo"
home: "/home/myinstan2"
gid: 543 # Default since not specified
uid: 544 # Default since not specified
...
- name: Creating DB2 Instance Users - default
user:
name: "myinstan2"
group: "myinadm2"
password: "foo"
home: "/home/myinstan2"
gid: 543 # Default since not specified
uid: 544 # Default since not specified
Assuming those gid/uid are not used by another user/group first and second tasks would succeed but not the third one since its using the same gid/uid as the second.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.