Instead of writing a whole new module, why not try to use netcommon module: https://docs.ansible.com/ansible/latest/collections/ansible/netcommon/cli_command_module.html
On Tuesday, July 20, 2021 at 11:41:25 AM UTC-4 [email protected] wrote: > >So, how are you getting the error "this operation requires privilege > escalation"? > > I was getting this error when i try to use the ios_config, wich is made > for cisco_ios. Fs.com switches base ios is cisco, but i dont know what is > their ios name (if they have a name) and i cant find it anywhere. When i > use ios_command the switch accept it because this dont go further to config > mode without my commands and i dont know if it a conflict because config > mode in cisco is config terminal and fs.com config mode is config only. > > > >There may only be source code. Not everyone documents the development of > things like this in sufficient detail that other developers can understand > the > design process. > > About this, im kynda new on ansible, and i cant find a "guide" on how to > build a module and that is maybe the hardest part... in my course ive > studied C,C++ and C# but we dont use python.. although everyone says to me > that if i can program with c i can easy learn python. The problem here is > actually, find a 'how to do a module guide'. > > >Sorry, but phrases like "small differences" and "for example" are not > enough to > write software. You need specifications - you need definite documentation > about > _exactly_ how things need to be done. > > > Here i got a manual that i am using to see what to do when cisco commands > not working (because some are different!) > > PoE+ Series Switches CLI Reference Guide | FS -> > https://img-en.fs.com/file/user_manual/poe+-series-switches-cli-reference-guide.pdf > > > Start with something simple. > > Make sure you can do one specific, simple command manually, and then get an > ansible module to do it for you. If you need escalated privileges, well, > put > that in (I assume you already know how to do that in ansible). > > Then, once you have something simple working, build up to the real goal of > the > full configuration you are trying to achieve. > > If you need further help from the list, though, I really think you need to > provide some details about what you are doing, what the errors are, and > what > the fs.com documentation says needs to be done to make something work. > > > So the point is to make a module to automate commands inside config mode > in the s3260-8T2FP switch from fs.com, i am using an s3900-24F4S switch > also from fs.com but this one i have since yesterday so im still testing > and learning how to work with it and for now it looks more similar to > cisco_ios than the other one.. > > I already make 2 roles that create vlans on the switch and link them with > a specific port. This roles are working but the module was a better project > for my internship since this roles are only working to fs with ios_command > and i have to make the commands all by myself. > > If i could do a module like ios_config but working to fs, not only i would > automate even better my roles, but also i would have a better project to > show in the present in the end of my internship. > > Hope you guys can help me!! > If u didnt understand something please ask me!! > > A segunda-feira, 19 de julho de 2021 à(s) 20:30:16 UTC+1, Antony Stone > escreveu: > >> On Monday 19 July 2021 at 19:13:21, Tiago Oliveira wrote: >> >> > I actually dont have anything of the module done. >> >> So, how are you getting the error "this operation requires privilege >> escalation"? >> >> > I wanted to see the ios_config module and how it was done so i could >> have >> > an ideia of what to do.. but i cant find the documentation and the how >> to >> > do that module. >> >> There may only be source code. Not everyone documents the development of >> things like this in sufficient detail that other developers can >> understand the >> design process. >> >> > About the fs.com switches, the one i am trying to use is a lot similar >> to >> > cisco ios, with small diferences. for example >> >> Sorry, but phrases like "small differences" and "for example" are not >> enough to >> write software. You need specifications - you need definite documentation >> about >> _exactly_ how things need to be done. >> >> > you do enable and then config and not config terminal, and i dont know >> if that >> > changes something for the module not working, because if i use >> ios_command >> > module and write all the commands: enable,config i can use this >> commands >> > inside fs switch config without problems.. >> >> Start with something simple. >> >> Make sure you can do one specific, simple command manually, and then get >> an >> ansible module to do it for you. If you need escalated privileges, well, >> put >> that in (I assume you already know how to do that in ansible). >> >> Then, once you have something simple working, build up to the real goal >> of the >> full configuration you are trying to achieve. >> >> If you need further help from the list, though, I really think you need >> to >> provide some details about what you are doing, what the errors are, and >> what >> the fs.com documentation says needs to be done to make something work. >> >> >> Antony. >> >> -- >> You can tell that the day just isn't going right when you find yourself >> using >> the telephone before the toilet. >> >> Please reply to the list; >> please *don't* CC me. >> > -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/8d206641-80a1-4ef0-b7cb-1852c99bf309n%40googlegroups.com.
