What is RBAC? You'll hear this term a lot if you become a professional system admin.
It doesn't only pertain to ansible, but of course this is about ansible, so we'll limit it for now.
Role-Based Access Control (RBAC) in Ansible is used to restrict and manage user access to resources based on their role within an organization. This helps ensure that users can only perform actions that they are authorized to do
Normally I would do this with an ansible GUI like AWX/Tower, but that's beyond the scope of this article.
For now, it pretty much comes down to what users have permissions to run which playbooks.
Instead of putting all your playbooks in a central local location and giving everyone read access to them, I recommend
putting webserver script in the webserver admin's home directory, and chown'ing him as the owner. The chmod the
file so no one else can see it.
Do the same for the database admin, give him custom playbooks, that only he can see and run.
Do the same for the network admin, and so on...
This can also be managed with ssh accounts and ssh keys. For example only give the webserver admins accounts on the webservers.
Only give the database admins accounts on the database servers, etc...
Being system admin is always being aware of security and permissions. There is an art to it that comes from experience.
It's difficult to read one or two articles like this and know everything you need to know.
I mentioned earlier, users can have custom hosts/inventory files. Remember you can only run scripts on the systems in your
hosts file. Don't put the IPs of the database servers in the webadmins directory. Don't put the webserver IPs in the host file
of the DBAs. Use a little common sense here. Now of course if you're the only guy running the whole show, then it doesn't matter
that much.
One nice thing about ansible, is that it is "agentless". You don't have to install any special software or client package in order for
it to work. All you need is ssh and python3. You can use ansible with AIX, Solaris, BSD, Newer Mac OS's, there is even some support
for Windows. (although Windows setup is a bit more complicated, there are additional steps required)
In part 1 we covered basic installation and how to run basic playbooks. In part 2 we covered some more advanced topics like
jinja2 variables, if and efif logic, and doing some basic math. We also talked about running multiple complex tasks in a single
playbook. Now we will get even more advanced in part 3.
It doesn't only pertain to ansible, but of course this is about ansible, so we'll limit it for now.
Role-Based Access Control (RBAC) in Ansible is used to restrict and manage user access to resources based on their role within an organization. This helps ensure that users can only perform actions that they are authorized to do
Normally I would do this with an ansible GUI like AWX/Tower, but that's beyond the scope of this article.
For now, it pretty much comes down to what users have permissions to run which playbooks.
Instead of putting all your playbooks in a central local location and giving everyone read access to them, I recommend
putting webserver script in the webserver admin's home directory, and chown'ing him as the owner. The chmod the
file so no one else can see it.
Do the same for the database admin, give him custom playbooks, that only he can see and run.
Do the same for the network admin, and so on...
This can also be managed with ssh accounts and ssh keys. For example only give the webserver admins accounts on the webservers.
Only give the database admins accounts on the database servers, etc...
Being system admin is always being aware of security and permissions. There is an art to it that comes from experience.
It's difficult to read one or two articles like this and know everything you need to know.
I mentioned earlier, users can have custom hosts/inventory files. Remember you can only run scripts on the systems in your
hosts file. Don't put the IPs of the database servers in the webadmins directory. Don't put the webserver IPs in the host file
of the DBAs. Use a little common sense here. Now of course if you're the only guy running the whole show, then it doesn't matter
that much.
One nice thing about ansible, is that it is "agentless". You don't have to install any special software or client package in order for
it to work. All you need is ssh and python3. You can use ansible with AIX, Solaris, BSD, Newer Mac OS's, there is even some support
for Windows. (although Windows setup is a bit more complicated, there are additional steps required)
In part 1 we covered basic installation and how to run basic playbooks. In part 2 we covered some more advanced topics like
jinja2 variables, if and efif logic, and doing some basic math. We also talked about running multiple complex tasks in a single
playbook. Now we will get even more advanced in part 3.