#4257 Migrate mediawiki puppet module to ansible
Closed: Fixed None Opened 10 years ago by adimania.

Mediawiki puppet module needs to go to Ansible setup.
We need to make mediawiki01/02/01.stg instances for it on the ansible side.


There is a define mediawiki::instance in puppet. Any ideas or examples on how to migrate it?

iptables define was done in a similar way and was moved to tasks/iptables.yml but I am not sure. Can someone help me here?

Well, what we want is a mediawiki role.

We used to have several mediawiki instances (smolt had one, and we had some other one), so it was setup to do multiple instances. I think we could hopefully do the role as well that way so we can pass in the name.

modules/mediawiki/manifests/init.pp is the main set of things that need to be migrated to a role. (installing packages, etc). We can use host variables to set which hosts have which instances on them.

Does that make sense?

I am attaching the main.yml of the mediawiki role.
Idea is that we'll have two variables, wikiname and wikisetup. Many actions will be taken on the basis of these variables.

Points to be noted:
I haven't tested nfs mount since I do not have access to any nfs device.
What will happen is wikisetup is empty or not defined?

ok. I have setup some new wiki instances in ansible.

Could you redo your changes against the current ansible repo with the files you need in the role/mediawiki/files/ and templates/ ?

A few other comments:

  • We don't need the php-pecl-json anymore, that was for rhel5, and we are all on 6 now. ;)

  • Shouldn't need httpd in the packages list, that should be taken care of by the "apache" task.

  • For nfs we should be able to use the nfs_client role.

  • I think you may be able to get rid of wikisetup. If a play runs and the file is already in place there, nothing should happen. Or you want to run it only sometimes?

Happy to expand on those...

Replying to [comment:4 kevin]:

ok. I have setup some new wiki instances in ansible.

Could you redo your changes against the current ansible repo with the files you need in the role/mediawiki/files/ and templates/ ?
Done

A few other comments:

  • We don't need the php-pecl-json anymore, that was for rhel5, and we are all on 6 now. ;)
    I removed it.

  • Shouldn't need httpd in the packages list, that should be taken care of by the "apache" task.
    Removed it as well

  • For nfs we should be able to use the nfs_client role.
    nfs_client role has /mnt hardcoded in it. I can create another task if you like. For now I have kept the mount task.

  • I think you may be able to get rid of wikisetup. If a play runs and the file is already in place there, nothing should happen. Or you want to run it only sometimes?
    +1 to the former. I have removed the var for that.

Happy to expand on those...

Attached a patch for you to review. Thanks for helping! :)

Thanks!

I applied this and tweaked/iterated on it some and now wiki in staging ( stg.fedoraproject.org/wiki ) is running on the ansible managed wiki01.stg instance. ;)

There's a selinux issue outstanding with reading LocalSettings file, but once that is sorted it should be good to move into production as well.

Thanks for all your work on this!

Login to comment on this ticket.

Metadata