ANXS / mysql

Ansible role for MySQL
MIT License
94 stars 70 forks source link

Add conditional for other mysql distributions #25

Closed bmanojlovic closed 8 years ago

bmanojlovic commented 9 years ago

Enable providing list of mysql packages into role, so that for example mariadb or galera mysql could be installed

With this you could write in playbook

   - role: ANXS.mysql
      mysql_packages:
        - mariadb-galera-server
        - mariadb-client
        - python-mysqldb
      mysql_databases:
      - name: wordpress
        collation: "utf8_general_ci"        # optional, defaults to "utf8_general_ci"
        encoding: "utf8"
marekkalnik commented 9 years ago

:+1:

soupdiver commented 9 years ago

looks ok for me to give you that freedeom :+1:

soupdiver commented 9 years ago

@bmanojlovic A note in the README about this would be good. Opinions in this @pjan @otakup0pe @farridav ?

farridav commented 9 years ago

Bit odd this one.. the task were proposing to change, loads in a list of packages to install using ansible_os_family.yml .. (So we can potentially support multiple distros), but we only have debian, futhermore, the next task in the play installs the packages via apt which is distro specific.. perhaps we can remove this load_vars task, and put those variables into defaults (allowing them to be overiden in a clean, predictable way)...

AFAICT this will support your use case @bmanojlovic ? thoughts @soupdiver ?

soupdiver commented 9 years ago

Fair point @farridav To be really distro independent we would need not only a specific variables file but a distro specific playbook. So there is no advantage of the vars file.

So +1 for the idea putting the packages in defaults/main.yml

bmanojlovic commented 9 years ago

I'm ok with defaults/main.yml idea, maybe in next few days i will have enough time to try to support redhat and suse targets

farridav commented 9 years ago

cool, feel free to @ me or @soupdiver when something is up to either move the vars to defaults, or properly support multiple distros and we will push this through

soupdiver commented 9 years ago

@bmanojlovic any news on this? :)

bmanojlovic commented 9 years ago

I apologize for no recent activity but it is on my TODO list, simply private life have bigger priority. Will try to finish it in some reasonable time.

bmanojlovic commented 8 years ago

I have updated to include initial support for centos but for now it is not complete as default my.cnf is broken for mariadb but idea is to show you basic idea maybe better idea would be to have "main" install.yml which imports/include for install_{{ ansible_distribution }}.yml, give me a shout what you would prefer; what is done now or expand this per distribution. One thing that i think should be good in any case is to try using ansible ini_file for any changes in my.cnf or (mariadb/mysqld).cnf files

farridav commented 8 years ago

See https://github.com/ANXS/postgresql/blob/master/Vagrantfile for how we offer centos as a different target.. I'd like to get some tests done on this before merge, got some promising work here https://github.com/ANXS/postgresql/pull/138 ..

bmanojlovic commented 8 years ago

I have updated travis build scripts, of course everything still fails, but initial things are set. Now here is time for hacking :-)

farridav commented 8 years ago

Hi @bmanojlovic .. I've just merged in a trivial PR that provides support for other mysql packages using the defaults approach mentioned above... I also took a brief look at your docker testing work ;) I welcome a run at docker testing if you want to close this PR and open a separate one .. I've also been looking at doing this myself, see https://github.com/ANXS/postgresql/pull/138

bmanojlovic commented 8 years ago

Yes it should be closed as it is become now a lot different from initial idea. Anyway yes docker works fine (except code is broken for all but debian and ubuntu). I will create new PR with docker changes.